Why are comments generally colored in python?

(*-*)浩
Release: 2019-08-10 15:40:15
Original
6807 people have browsed it

Comments in Python include single-line comments and multi-line comments:

Why are comments generally colored in python?

Single-line comments in Python start with #, for example: (Recommended learning: Python video tutorial)

For single-line comments, just use a #, and the commented text is displayed in red (different editors display different colors)

# 创建字典
Copy after login

As shown in the picture:

Why are comments generally colored in python?

Use three single quotes for multi-line comments. Be careful to use three single quotes at the beginning of the comment, and at the same time The text of the annotation is displayed in green (different editors display different colors)

'''
多行注释
多行注释
多行注释
'''    
print("ok")
Copy after login

As shown in the picture:

Why are comments generally colored in python?

More Python related technologies Article, please visit the Python Tutorial column to learn!

The above is the detailed content of Why are comments generally colored in python?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!