官术网_书友最值得收藏!

Commenting Python code

Another thing to discuss is that comments in Python are marked with the # symbol. Comments are used to annotate notes or other information without having Python try to perform an operation on them. For example, the following screenshot demonstrates the use of comments when writing code. It should be noted that, normally, comments in the interactive Python prompt are not used, since it is more of a scratchpad for testing bits of code:

Python comments

You will see later on that, even though Python is a very readable language, it still helps to put comments in your code. Sometimes, it's to explicitly state what the code is doing, to explain a neat shortcut you used, or to simply remind yourself of something while you're coding, like a "to do" list.

主站蜘蛛池模板: 沐川县| 通化市| 廊坊市| 内黄县| 衢州市| 邢台县| 永登县| 德兴市| 邻水| 南城县| 花垣县| 台北市| 祁阳县| 麦盖提县| 聊城市| 兴文县| 云林县| 含山县| 四会市| 扎兰屯市| 安徽省| 太康县| 陕西省| 腾冲县| 湘西| 阿瓦提县| 大同县| 新巴尔虎右旗| 平乐县| 芮城县| 广平县| 北京市| 西安市| 来凤县| 温州市| 衡水市| 东光县| 深泽县| 天全县| 溆浦县| 青铜峡市|