- Learn Programming in Python with Cody Jackson
- Cody Jackson
- 136字
- 2021-06-10 19:06:06
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.
推薦閱讀
- 零基礎玩轉區塊鏈
- 深入淺出WPF
- Python Game Programming By Example
- 網絡爬蟲原理與實踐:基于C#語言
- GameMaker Programming By Example
- 軟件架構:Python語言實現
- Yocto for Raspberry Pi
- INSTANT Passbook App Development for iOS How-to
- PHP 7+MySQL 8動態網站開發從入門到精通(視頻教學版)
- C語言程序設計
- Java高并發核心編程(卷1):NIO、Netty、Redis、ZooKeeper
- Clojure for Machine Learning
- 后臺開發:核心技術與應用實踐
- Mastering Apache Storm
- UX Design for Mobile