首页 开发语言 Python 正文

Python学习笔记

尼克璞头像 尼克璞 Python 2022-06-17 10:06:17 0 751

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.

注意:若非特殊说明,文章均属本站原创,转载请注明原链接。
标签: Python 大数据

相关推荐

欢迎 发表评论:

«    2025年6月    »
1
2345678
9101112131415
16171819202122
23242526272829
30