- 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.
推薦閱讀
- Python編程與幾何圖形
- Android 應用案例開發大全(第3版)
- Web程序設計(第二版)
- Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)
- Python機器學習基礎教程
- 全棧自動化測試實戰:基于TestNG、HttpClient、Selenium和Appium
- Learning Apache Cassandra
- 新一代SDN:VMware NSX 網絡原理與實踐
- Mastering Web Application Development with AngularJS
- 3ds Max印象 電視欄目包裝動畫與特效制作
- 計算機應用基礎項目化教程
- Apache Solr PHP Integration
- JavaScript Unit Testing
- Three.js Essentials
- Learn C Programming