导语:
本文主要介绍了关于python中井号怎么用的相关知识,包括python中的井号键是什么意思,以及python注释这些编程知识,希望对大家有参考作用。
注释是编程的重要组成部分。它可以告诉你这段代码的用途,或者它可以用来删除一段你现在不需要执行的代码。下面演示如何
python中使用注释:
# 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 a piece of code:
# print "This won't run."
print "This will run."
从上面可以看出,Python中的#是用来写注释的,一般都是写单行注释。
本文为原创文章,版权归知行编程网所有,欢迎分享本文,转载请保留出处!
你可能也喜欢
- ♥ 如何用python写月份10/17
- ♥ 如何从python的列表中删除重复元素10/30
- ♥ 20个有用的python代码片段(3)12/27
- ♥ python中的%是什么?如何使用?09/15
- ♥ 如何下载python包10/25
- ♥ python获取本地时间12/15
内容反馈