First use of python notes (not getting started), python notes
I have never been familiar with python before. Here I will write my own learning process and experience on python.
First, install python, open the official website: http://python.org. Click Download. I chose 3.5.1 version for installation.
Next, follow the tutorial to start learning:
Then we started the first classic program and entered the following command in the interactive Interpreter:
>>> Print "hello world! ";
An error occurred at the beginning. The error message is: "SyntaxError: invalid syntax".
It turns out that this is the syntax of version 2. Version 3 should be enclosed in brackets, so you should enter
>>> Print ("hello world! ");
After correction, click "enter" and the next line will print hello world!
Next, we will find that the algorithms, variables, statements, functions, modules, and strings introduced in the tutorial are very similar to C ++ \ C #, so it is easy to learn. The difference is that python does not add any extra points at the end of each line, but it requires a high format.
When the python interactive editor exits, everything input will be lost. Therefore, you need to save the program in the text editor and install python with its own IDLE. After opening the New File, you can write code in a New editing window, it is very convenient. It neither has an interactive prompt nor can automatically detect line breaks.
Similarly, input print ("hello world! ");
Save and click Run Python Shell or press Ctrl + F5 to Run.
The Python interactive interpreter cannot save programs, while the programs saved by IDLE can be run using Python Shell.
Q: What are their differences?