Data Types

Run Settings
LanguagePython
Language Version
Run Command
#Fundamental Data Types #int and float print(type(2+4)) print(type(2-4)) print(type(2*4)) print(type(2/4)) print(2**3) # 2 to the power 3 print(2//4) # floor division. divides left operand by right and returns quotient as int. and rounds down to the nearest integer print(6%4) #6 modulo 4. gives remainder of the division. print(bin(5)) print(int('0b101',2)) #where '2' is base 2.
#Fundamental Data Types int float bool str list tuple set dict complex #creates a complex number from a real part and an optional imaginary part.This is equivalent to (real+imag*1j) where imag defaults to 0. bin # returns binary representation of an integer. #Classes -> custom types #Specialized Data Types None
#Fundamental Data Types int #integers or whole numbers. used to do mathematical operations float # a number with decimal point. print(type(2+4)) print(type(2-4)) print(type(2*4)) print(type(2/4))
#math functions round(3.1) print(2**3) # 2 to the power 3 print(2//4) # floor division. divides left operand by right and returns quotient as int. and rounds down to the nearest integer print(6%4) #6 modulo 4. gives remainder of the division.
Editor Settings
Theme
Key bindings
Full width
Lines