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.