知行编程网知行编程网  2022-09-21 16:30 知行编程网 隐藏边栏  148 
文章评分 0 次,平均分 0.0
导语: 本文主要介绍了关于python中井号怎么用的相关知识,包括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中的#是用来写注释的,一般都是写单行注释。

本文为原创文章,版权归所有,欢迎分享本文,转载请保留出处!

知行编程网
知行编程网 关注:1    粉丝:1
这个人很懒,什么都没写
扫一扫二维码分享