Primitive Datatypes: ===================== Integer Datatype decimal binary octal hexadecimal Base Conversions: ================== 1) Any base to binary conversion: ================================= bin() 2) Any base to Octal Conversion: ================================ binary ==> octal decimal ==> octal hexadecimal ==> octal oct(): ===== used to convert any base value into octal value (base-8 value) Syntax: oct(any base value) # binary to octal a = 0b110110010110 print(oct(a)) # decimal to octal b = 100 print(oct(b)) # hexadecimal to octal c = 0xaf12 print(oct(c)) ====================================== 3) Any base value into hexadecimal: =================================== decimal ==> hexadecimal binary ==> hexadecimal octal ==> hexadecimal hex(): ===== used to convert any base value into hexadecimal value Syntax: hex(any base value) # decimal to hexadecimal a = 100 print(hex(a)) # binary to hexadecimal b = 0b110010011101 print(hex(b)) # octal to hexadecimal c = 0o6754 print(hex(c)) ============================================== Float Datatype: =============== ==> number with decimal point (1.23, 0.001) ==> the scientific value/exponent value 7e-9 or 7E9 ==> exponent values 7 X 10^-9 or 7 X 10^9 ==> pre-defined datatype built-in class ==> float a = 1.23 b = 1e-9 c = 7E9 print(type(a)) print(type(b)) print(type(c)) Note: ==== only the decimal values are allowed for float data definition (no binary, no octal and no hexadecimal as float)