python basis of the while loop and coding acquaintance

while condition:
loop

Infinite loop: no termination condition (Review: 1. 2. Use change condition BREAK)

break terminates the current cycle
contiune: out of this cycle, the next cycle to continue to
break and contione must be within the loop body
while condition:
loop
else:
the results
appear break when the while loop, the loop will not continue l

Formatted output:

% s strings, numbers can be used (more commonly used, correspond to the position and fill)
%% i and D digital placeholder
%% escape

f "{variable name (except for special characters}"
the format {}
'Hao123.com the I Love' >>> 'Love {A} {B}. {C}'. the format (A = 'the I', B = 'hao123 ', c =' com ') # keyword
' I love hao123.com '>>>' { 0} love {b}. {c} '. format (' I ', b =' hao123 ', c =' mixed com ') # locations and keywords

Operators:
arithmetic operators: + - * / (addition, subtraction)% modulo exponentiation // ** divisible (rounded down)
comparison operators: <less than> greater than == Equal! = Not equal
assignment operator: = c = 1 + = assignment from plus c + = 1 is equivalent to. 1 C + C = C = C = A is equivalent to C A C / A = equivalent to c = c / a
logic operation Fu: and or not priority ()> not> and> or
member operator: in not in not in

Coding acquaintance
ascii code does not support the Chinese one byte
gbk (GB) English one-byte Chinese two-byte
Unicode (Unicode) English four Chinese four
utf-8 English 1 byte 2 bytes Owen Asian 3 bytes
1 byte 8bit == == 8 1bytes
1024byte = 1KB
1024KB 1MB =
1024MB = 1GB
1024GB = 1TB
1024TB 1PB =
1024TB = 1EB
1024EB = 1ZB
1024ZB = 1YB
1024YB = 1NB
1024NB = 1DB

Guess you like

Origin www.cnblogs.com/python111/p/11426103.html