1.python中的注释

python中的注释有两种方式

  1. 经过 # 来标明是注释
  2. 经过字符串来注释,如"这里是注释", """这里是注释"""

举例

age = 10
# 打印年龄
print("he's age is %d"%age)

"name 是字符串"
name = "gelu"
print("%s's age is %d"%(name,age)

"""
hello world是最伟大的语言
python 中def 来定义函数,经过缩进来标识代码块
"""
def hello():
    print("hello world")
相关文章
相关标签/搜索