When you start Python, the following prompt appears:
This is the entrance to the hall of Python, the first step in controlling the calculation, and this is the interactive Python interpreter. Enter the following code:
When you hit the ENTER key, get the following output:
This is the first Python program, and the program is gone after the interactive interpreter exits. The interactive interpreter is a temporary program that runs the environment without saving the running program.
The program we write is ultimately saved in the file. So the next time we want to run the program, we can run the program file we saved last time.
Now let's write a simple Python program.
Open Notepad and write the following to the file:
Print ("Hello world!")
Save as helloworld.py file,. py suffix is to let others know that this is a python file.
In the DOS window, enter the following command and hit enter to get the same output.
The first Python program