简体   繁体   English

我想评论我的 python 代码,我不知道 python 中多行评论的符号是什么

[英]I want to comment my python code and i Don't know what is the symbol of multiple line comment in python

How do I make multi-lined comments in python?如何在 python 中进行多行评论?

My Code So Far:到目前为止我的代码:

print("Hello world")
print("Hello universe")
print("Hello everyone")

You can either paste # at the beginning of each row:您可以在每行的开头粘贴#

#print("Hello world")
#print("Hello universe")
#print("Hello everyone")

Or use this syntax:或者使用以下语法:

"""print("Hello world")
print("Hello universe")
print("Hello everyone")"""

Python does not have a syntax for multi-line comments. Python 没有多行注释的语法。 The only thing you could do is comment on each and every line.您唯一可以做的就是对每一行进行评论。 Or you could do as Claudio said to use """Comments here""" for multi-lined comments.或者您可以像 Claudio 所说的那样使用““此处评论”””进行多行评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python注释多行 - Python comment multiple line 我不知道这个python代码有什么问题 - I don't know what is wrong with this python code Python:我的代码出错,我不知道如何修复它 - Python: Error in my code and i don't know how to fix it 我想在python代码中添加ssl证书,但我不知道如何在代码中添加它 - I want to add ssl certificate in python code but i don't know how to add it in the code 我的代码有什么问题? 我是新手,我不知道为什么它不起作用。 (Python) - What is wrong with my code? I am a newbie and I don't know why it isn't working. (Python) 我想清理 Python 中的列表,但我不知道该怎么做 - I want to clean my list in Python but I don't know how to do 我想编译我的 python 项目,但我不知道该怎么做 - I want to compile my python project and i don't know how to do that 我想在python代码中的每条if语句的末尾添加注释标记,如何实现? - I want to add a comment mark to the end of every if statement in python code, how can I do it? Python的新手,不知道我的代码出了什么问题 - New to Python, don't know what is wrong with my code 我试图只使用while循环在python中编写此代码,但我不知道它有什么问题? - I'm trying to write this code in python only using while loops, but I don't know what is wrong with it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM