Python is a cross-platform computer programming language. It is a high-level scripting language that combines interpretation, compilation, interactivity and object-oriented. It was originally designed for writing automated scripts (shells). As the version is constantly updated and new language features are added, it is increasingly used for the development of independent, large-scale projects.
Comments: Contents that are not executed by the machine, comments are generally written in natural language.
Python comment method:
① Line comment: starts with a hash (#) number, which can be a separate line or in a certain line of code Behind .
# 这是打印hello world print('hello wordl') # 这是打印hello world
② Block comments: Several lines of code or content, starting and ending with three consecutive single quotes or double quotes, any content in between will be ignored by the machine.
Example 1: Three consecutive single quotes starting and ending.
''' 注释。。。 这是打印hello world 注释。。。 ''' print("hello wordl")
Example 2: Three consecutive double quotes starting and ending.
""" 注释。。。 这是打印hello world 注释。。。 """ print("hello wordl")
Related recommendations: "Python Tutorial"
The above is the detailed content of What are the Python annotation methods?. For more information, please follow other related articles on the PHP Chinese website!