Basic Data Types

Integer

Numbers such as 1,2,3,99

String

Characters such as 'nfakjd34'

Boolean

Stores True or False values

Float

Stores DECIMAL numbers

Function type:

print(type(12))
#returns int

print(type('number'))
#returns str

print(type(12.08))
#returns float

#boolean
adult = True
print(type(adult))
# returns bool

Dynamic Typing in Python:

Same variable can change types

adult = True
pass
# extra code
adult = 5
print(type(adult))
# returns int eventhough adult started as bool

Last updated