First, formatted output%
Text%s
Number%d
#name = input (' Please enter name: ')#age = Int (input (' Please enter Ages: '))#job = input (' Please enter job name: ')#Hobbie = input (' Please enter hobby: ')#msg = " '#------------Info of%s-----------#Name:%s#Age :%d#Job:%s#Hobbie:%s#-------------End-----------------#"% (Name,name,age,job,hobbie)#Print (msg)formatted output
Second, operator
() > Not > and > or
Sibling words from left to right sequentially
is divided into two cases (both before and after the comparison, both front and back are numbers)
Third, while Else
The while loop ends with the else, and if a break is encountered, it jumps directly without executing else
#count = 1#While count <= 5:#print (count)#count = count + 1#Else: #循环结束走else#print (' Cycle finished ')#print (' I have the bottom line ')#count = 1#While count <= 5:#print (count)#count = count + 1#if Count = = 4:#Break #当count满足if条件时直接走下面break跳出, don't go else#Else:#print (' 1 ')While else
Four, the first knowledge of coding
I. ASCII: Letters, numbers, special characters
A 8-bit consists of a byte that consists of one character.
Characters: the smallest unit that makes up the content
Second, universal code Unicode
16 bits, which are expressed in two bytes, such as Chinese characters, cannot be represented by a complete
Upgrade:
32 bits, all in 4 bytes, waste of resources
Upgrade:
Utf-8: Minimum 8 bits for one character
A: one byte (8 bits)
European text: two bytes (16 bits)
Asian text: Three bytes (24 bits)
UTF-16: Minimum 16 bits for one character
Third, GBK (national standard)
A: one byte (8 bits)
English: two bytes (16 bits)
Four, 8-bit 8bit= 1byte
1024bytes =1kb
1024KB = 1MB
1024MB = 1GB
1024GB = 1TB
Python 4.27