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

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.

主站蜘蛛池模板: 怀柔区| 鹰潭市| 太仆寺旗| 迁安市| 馆陶县| 澎湖县| 大冶市| 江源县| 申扎县| 汝南县| 佳木斯市| 云林县| 太仓市| 绵阳市| 汉阴县| 涞源县| 平顶山市| 佛冈县| 祁门县| 汶上县| 江孜县| 东乡族自治县| 惠水县| 河东区| 定襄县| 瓦房店市| 亳州市| 财经| 承德县| 景泰县| 攀枝花市| 临沧市| 阿坝县| 金昌市| 民县| 阳谷县| 乳源| 塔城市| 炉霍县| 潞城市| 潜江市|