One. The origins of Python
Python is an explanatory weak-type programming language.
Features: Simple. Clear. Elegant
Two. The Python interpreter
CPython. is provided by the official. Internal use of the C language to implement
PyPy. To interpret our code as a bytecode file at once. You can run it directly.
Three. The first Python program
Print (any content)
Four. Variable
The intermediate value produced during the run of the program. Temporarily saved in memory. For subsequent programs to use the
naming convention:
1. Use letters, numbers, underscores
2. Cannot start with a number, not a pure number
3. You cannot use the Python keyword
4. Don't be too long
5.
6. Case Sensitive
7. Do not use Chinese
8. It is recommended to use the hump or Underline
Five. The data type of the variable
1. int. Integer. You can do +,-, *,/,%,//
2. str. String. can be + *
3. bool. A Boolean value. Two values. True, False
Six. User interaction
Variable = input (Prompt)
received is the string type
str = > int = int (str)
Seven. Process Control (IF)
If condition:
code block
If condition 1:
code block 1
Else:
code block 2
If condition 1: br> code block
elif Condition 2:
code block
Elif ....
Else:
If condition:
If condition:
If condition:
code block
Else:
else:
---restore content ends---
I. Python Basics