1. Output
#OutputPrint()Print("Hello World")Print("Hello","Willow","Output")Print("+ + =", 100+200)Print(100+200)
2. Enter
# inputname = input () nameprint= input ("pleaseEnter your name: " )print("Hello,", name)
3. Code block
Code block with: and four spaces in the indentation in the embodiment
# print absolute value of a inta =if a>=0: print(a)else : Print (-a)
4. Save and run
In the Python command-line interactive environment, you can only enter one line of code and execute one line. Can't save and run again, and if you want to run again, you need to enter the same code again, what do you do?
We can choose a text editor, for example: Sublime text, write the code in, save the file as. py, and then go to the cmd command line
1) Enter the folder under which the. py file is saved
2) more + *.py can see all the contents of the file
3) Python + *.py execute this file
Ps: Under Windows. py file is no way like the. exe file, double-click the run, must pass the above steps. Python's idle also has no effect.
Python (ii) run the first Python program