入门 Python 该学哪些知识点?该看哪些书?
可以练手做项目的 Python 项目去哪里找?好用的爬虫工具又有哪些?
网上看了很多文章,但感觉没有个系统,号主有 Python 零基础入门资料推荐吗?
加号连接
+
号的形式:>>> a + b
‘hello world’
逗号连接
>>> print(a, b)
hello world
(‘hello’, ‘ world’)
直接连接
print(‘hello”world’)
… a = ‘a”b’
…
>>> dis.dis(x)
2 0 LOAD_CONST 1 (‘ab’)
3 STORE_FAST 0 (a)
6 LOAD_CONST 0 (None)
9 RETURN_VALUE
百分号 %
format函数
join函数
f-string
>>> f'{aa} {bb}’
‘hello world’
星号 *
>>> aa * 3
‘hello hello hello ‘
>>> a*2
[1, 1]
>>> a.__mul__(3)
[1, 1, 1]
小结
b = ‘姓名:’ + name + ‘年龄:’ + age + ‘性别:’ + gender
本文来自投稿,不代表程序员编程网立场,如若转载,请注明出处:http://www.cxybcw.com/203780.html