Lao Jia happy life day5 while loop encoding format operator acquaintance
Others
2019-08-03 06:54:19
views: null
while loop infinite loop
while conditions:
print (result)
while conditions:
print (result)
else:
print (result)
break terminates the current cycle
continue out of the current cycle, the next cycle
It becomes infinite loop while loop control cycles may be achieved by changing the conditions.
E.g:
a = 10
while num >5:
print (whether)
a - 1 =
format:
% S string placeholder
% D% i numeric placeholders
f placeholder
%% Escape
E.g:
info = """
--------info----------
Name:% s
Gender:% s
Work:% s
Tel:% s
--------end----------
"""
print(info%(name,sex,job,tell))
info = """
-----------info----------
Name:% s
Age:% s
Company:% s
Tel:% s
------------end-----------
"""%(name,sex,job,tell)
print(info)
info = f"""
-----------info----------
------------end-----------
"""
print(info)
Formula: f + {} string in the string to be replaced to write the content.
Operator:
Arithmetic, + - * / ** //%
Comparing> <==! = <=> =
Logic, not and or
Assignment + = - = * = / =% = ** = // =
Members in not in
Logic: and a true false take a false
After taking a whole truth
Take a former all-false
a true or a false get real
Take the whole truth before a
After taking a full false
not non
Coding acquaintance:
ascii code 256 United States, no Chinese
1 byte
gbk code (GB)
English 1 byte
Chinese 2 bytes
Unicode unicode 3.6 or later
Chinese, English is four bytes
utf-8
English one byte
Europe 2
Asian 3
win - coding gbk
linux - encoding utf-8
mac - encoding utf-8
1 byte == 8
***** 1 byte == 8 **** <==> 1B == 8b ******
1B = 8b
1KB = 1024B
1MB = 1024 KB
1GB = 1024MB
1TB = 1024GB
1PB = 1024TB
1EB = 1024PB
Origin www.cnblogs.com/lingege/p/11291396.html