ITPub博客

首页 > IT职业 > IT职场 > python中井号怎么用

python中井号怎么用

IT职场 作者:wengwb 时间:2021-09-11 10:27:36 0 删除 编辑

注释在编程中是很重要的部分。它能告诉你这段代码是干什么用的,或者用来删除一部分你暂时不需要执行的代码。下面演示的是如何在

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学习网,免费的python学习网站,欢迎在线学习!

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2216/viewspace-2835564/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-16

  • 博文量
    63
  • 访问量
    511