operator
1. Arithmetic Operation:
2. Comparison operation:
3. Assignment Operation:
4. Logical Operation:
5. Member Arithmetic:
1Name ="Yehaoran" #In to determine if ye is inside the name, return OK not return not2 #if "Ye" in Name:3 #print ("OK")4 #Else:5 #print ("not")6 7 if "ran" not inchName:8 Print("OK")9 Else:Ten Print(" not")#in does not determine if the RAN is not inside the name, return OK returns notmember Operations
Basic data types
1. Digital
int (integral type)
On a 32-bit machine, the number of integers is 32 bits and the value range is -2**31~2**31-1, which is -2147483648~2147483647
On a 64-bit system, the number of integers is 64 bits and the value range is -2**63~2**63-1, which is -9223372036854775808~9223372036854775807
1 #Numeric int2 #Python3, 1111111111111122333 numbers are used int3 #Python2, numbers are too large with a long small int4 5 #1. Convert a string to a number type View data type6 #a = "123"7 #Print (Type (a))8 #b = Int (a)9 #print (type (b))Ten #B = B + One #print (b) A - - #2. Convert to 10 binary in 16 binary format the #num = "a" - #v = int (num, base=16) - #Print (v) - + - #3, the current number of binary, at least with n-bit representation + ## a = 123 A ## r = a.bit_length () at ## Print (R)
several uses of int
Python basic data Type Day2