HomeToolsAbout

Data Types

Data Types

# string type string = "str" # primitive type # numeric types integer = 20 # primitive type float = 20.5 # primitive type complex = 1j # sequence types list = ["apple", "banana", "cherry"] tuple = ("apple", "banana", "cherry") range = range(6) # mapping types dict = {"name" : "John", "age" : 36} # set types set = {"apple", "banana", "cherry"} frozenset = frozenset({"apple", "banana", "cherry"}) # boolean types boolean = True # primitive type ## must be capitalized # binary types bytes = b"Hello" bytearray = bytearray(5) memoryview = memoryview(bytes(5)) # None type NoneType
AboutContact