2.程序的注释—— #
前言
程序的注释很重要!有两个重要的作用:
(1) 说明某段代码的作用。
(2) 临时禁用这段代码。
# 号,英文为octothorpe或者pound character。
一、Atom文本编辑器
注释的作用。
# A comment, this is so you can read your program later.
# Anything after the # is ignored by python.
print("I could have code like this.") # and the comment after is ignored
# You can also use a comment to "disable" or comment out code:
# print("This won't run.")
print("This will run.")
二、运行Python程序
在Window上键入Python就可以看到结果。
python ex2.py
总结
以上内容介绍了注释("#")的作用,有关Python、数据科学、人工智能等文章后续会不定期发布,请大家多多关注,一键三连哟(●’◡’●)。