One. The basics of Python
1. Encoding
#-*-Coding:utf8-*-
Meaning to encode using utf8d
ascill 00000000
& 00000001
unicode 0000000000000000+
& nbsp;& 0000000000000001
in 001000000000000111110010
utf-8 How much you can use to represent
less in utf-8, especially in a Character encoding in Scill
& 0000 0001
0010 0000 0000 0001 1111 0010 span>
You need to use the above statement in Python2
Not required in Python3
Basic input and output statements for 2.python
n = input (' Please enter user name:') # Default input Gets the character type
Print (n) #
3. Variable name
Letters
number
Span style= "COLOR: #000000" > underline
 
exception: You cannot start with a number
python keyword, and you cannot use
' and ', ' as ', ' assert ',
' Break ', ' class ', ' cont Inue ', ' def ', ' del ', ' Elif ',
' Else ', ' except ', ' exec ', ' finally ', ' for ', ' From ',
' global ', ' if ', ' Import ', ' on ', ' is ', ' lambda ', ' not ', Br> ' or ', ' pass ', ' print ', ' raise ', ' return ', ' try ', ' while ',
' with ', ' yield
Two. Conditional statements and basic data types
1.if Else statement
N1 = input ('Please enter:')ifN1 = ='Alex': N2= Input ('>>>')ifN2 = ='Confirm': Print ('Alex SB')Else: Print ('Alex DB')Else: Print ('Error')
Attention:
N1 = "Alex" Assignment
N1 = = ' Alex ' comparison,
If or else follow the code fast is better 4 spaces
And you have to have the same number of spaces two.
2.if elif Statement
If condition 1:
Pass
Elif Condition 2:
Pass
Elif Condition 3:
Pass
Else
Pass
Print (' End ')
Python First Knowledge