ps while: continue: continue, terminate the current loop, and start the next loop break: terminate all loops
GBK format encoding Chinese characters are 2 bytes, and utf-8 is 3 bytes. Legacy jobs yesterday: user login (three opportunities ) # 3 opportunities to consider using while loop code: count = 0 while count <3: user = input ('dada') if user == 'shuaibi': print ('Welcome to log in') break else: print ('caiji ') count = count + 1 print (' endswith ')
4.17 learning content 1. Operator: // The quotient retains the integer % surplus / quotient Boolean value: True / False string / character, if the character is inside the string, it can be expressed as a subsequence ! = / <>: Not equal to pycharm: ctrl +? Indicate a large comment 2. The basic data type number int string is converted to a number int (str) num = '0011' v = int (num, base = 16) # the original meaning of num is defined as hexadecimal, converted to Decimal print (v) bit_length #Binary of the current number, at least n bits are used to represent the string str