1 初始编码 2 01010100 新 3 11010000 开 4 11010100 一 5 01100000 家 6 11000000 看 7 11000000 看 8 9 01010100011101110101011110110 10 A B C 11 01000001 01000010 01000011 12 电报,电脑的传输,存储都是01010101 13 14 最早的'密码本' ascii 涵盖了英文字母大小写,特殊字符,数字。 15 01010101 16 ascii 只能表示256种可能,太少, 17 创办了万国码 unicode 18 16表示一个字符不行,32位表示一个字符。 19 A 01000001010000010100000101000001 20 B 01000010010000100100001001000010 21 我 01000010010000100100001001000010 22 Unicode 升级 utf-8 utf-16 utf-32 23 8位 = 1字节bytes 24 utf-8 一个字符最少用8位去表示,英文用8位 一个字节 25 欧洲文字用16位去表示 两个字节 26 中文用24 位去表示 三个字节 27 utf-16 一个字符最少用16位去表示 28 29 gbk 中国人自己发明的,一个中文用两个字节 16位去表示。 30 31 11000000 32 33 优先级&& 34 1bit 8bit = 1bytes 35 1byte 1024byte = 1KB 36 1KB 1024kb = 1MB 37 1MB 1024MB = 1GB 38 1GB 1024GB = 1TB 39 #and or not 40 #优先级,()> not > and > or 41 # print(2 > 1 and 1 < 4) 42 # print(2 > 1 and 1 < 4 or 2 < 3 and 9 > 6 or 2 < 4 and 3 < 2) 43 # T or T or F 44 #T or F 45 # print(3>4 or 4<3 and 1==1) # F 46 # print(1 < 2 and 3 < 4 or 1>2) # T 47 # print(2 > 1 and 3 < 4 or 4 > 5 and 2 < 1) # T 48 # print(1 > 2 and 3 < 4 or 4 > 5 and 2 > 1 or 9 < 8) # F 49 # print(1 > 1 and 3 < 4 or 4 > 5 and 2 > 1 and 9 > 8 or 7 < 6) # F 50 # print(not 2 > 1 and 3 < 4 or 4 > 5 and 2 > 1 and 9 > 8 or 7 < 6) # F 51 52 #ps int ----> bool 非零转换成bool True 0 转换成bool 是False 53 # print(bool(2)) 54 # print(bool(-2)) 55 # print(bool(0)) 56 # #bool --->int 57 # print(int(True)) # 1 58 # print(int(False)) # 0 59 60 61 '''x or y x True,则返回x''' 62 # print(1 or 2) # 1 63 # print(3 or 2) # 3 64 # print(0 or 2) # 2 65 # print(0 or 100) # 100 66 67 68 # print(2 or 100 or 3 or 4) # 2 69 70 # print(0 or 4 and 3 or 2) 71 '''x and y x True,则返回y''' 72 # print(1 and 2) 73 # print(0 and 2) 74 print(2 or 1 < 3) 75 print(3 > 1 or 2 and 2) 76 77 78 while....else 循环 79 count = 0 80 while count <= 5 : 81 count += 1 82 if count == 3:break 83 print("Loop",count) 84 85 else: 86 print("循环正常执行完啦") 87 print("-----out of while loop ------")