Pick up the top
1, Control flow statement
1.1 If statement
A = 3
If a = = 1:
Print ("A is 1")
elif A = = 2:
Print ("A is 2")
Else
Print ("A is not a or 2")
Run results
A is not a or 2
Multiple or 0 Elif,else branches that correspond to an if statement are also optional
2,while statements
3,for...in statements
Letter:letter: (Letter,): (Letter,)
The result of the operation is:
Q is a consonant
A is a vowel
Z is a consonant
W is a consonant
S is a consonant
X is a consonant
E is a vowel
D is a consonant
C is a Consonan
4, basic exception handling
5, arithmetic operator
A+=8 equivalent to A=a+8
But for complex expressions, that's not true.
6, input \ Output
Input redirect Test.py<test.data
7, creation and invocation of functions
def functionname (arguments):
Suit
Parameters are optional and multiple parameters are separated by commas
Python Learning Note 2---key elements 2