This article is the author's original, reproduced also please indicate the source.
This article only represents the author's own views, for reference only. If you have any objection, you are welcome to discuss.
Forrest
Catalog
1.The first python source file
2.The points need to be noticed
5.The basic format of python program
1.The first python source file
Firstly, we need to enter the IDLE, then choose file -> new file;
Then a new .py file has been created as no name. Then it needs to be saved with a customized name.
Below is my example for training.

Figure1: my first python source file
2.The points need to be noticed
There are fews points need to be noticed:
1. Do not use the blank casually. Because in python syntax, blank indicates "indent", 缩进的意思
2.Do not use the chinese charactor like brackets -> ' ( ', quotations -> ' " ', commas->' , '.
3.Example running results

Figure2: my first python source file running results
4.The second example
Figure3: my second python source file running results
5.The basic format of python program
(1). The blank in front of one row, and one Tab(4blanks), intend to decide the level of indentation in a logical way, so it could divide the group of your program.
(2). The sentence starts from this first character of one row.
Ok, this is the end of our today's lesson learn, please stay tuned on the next episode.
本文介绍了Python初学者如何创建第一个源文件,注意事项包括正确使用缩进和避免中文字符。通过实例展示了运行结果,并详细解析了Python程序的基本格式,包括缩进规则和语句结构。适合编程新手学习Python基础。

208

被折叠的 条评论
为什么被折叠?



