1.python最具特色的就是使用缩进来表示代码块,即无需像PHP一样使用“{}”符号,但需要保持缩进一致,否则会报错。
2.多行语句使用 \ 来进行连接如:
total = item_one + \
item_two + \
item_three
3.在 [], {}, 或 () 中的多行语句,不需要使用反斜杠 \,例如:
total = ['item_one', 'item_two', 'item_three',
'item_four', 'item_five']
4.pthon的注释方式
第一种:
#注释1
第二种:
'''
注释2
'''
第三种:
"""
注释3
"""
5.