1. Output string:
Print (" string ")
2. Open the document file with python :
CMD Command indicator
CD C + + where cd is Chang directory Change directory, with tab key to quickly find the target file
Dir View current directory file list
3, thecmd operation:
D: The second time you change the directory without adding \
CD: return to the previous level directory
Cd.. \.. go back to the two-level directory
Execute Command Destination file directory open a file with the program you are using
Exit exits
-V View version
4. Description Data:
Student_numbers=1 using underscores instead of spaces
Studentnumbers=1 Hump Body
Pie=3.14 constants All in uppercase
5. Delete variables:
Del variable
6. View variable types:
Print (Type ( variable ))
7. Comments:
# Command line comment
"' command
command ' multiline comment '
8. Interactive applet:
death_age=100
Name=input ("Your Name:") input result defaults to string
Age=input ("Your Age:")
Print ("Can Live", death_age-int (age), "years!")
string to Integer:int ( data )
Integer to string:str ( data )
9, Guess the Age program:
age_of_god=100
Guess_age=int (Input ("Guess_age:"))
If age_of_god==guess_age: use double equals when judging
Print ("You are right!") Note tab indent
Else
Print ("You are wrong!")
10. Multi-Branch if statement:
Score=int (Input ("score:"))
If score>90:
Print ("A")
Elif Score>80:elif=else If
Print ("B")
Elif score>70:
Print ("C")
Else
Print (" dumb ")
Python Notes---DAY1: basic operations, if statements