Codzy

Data types

Every value has a type. The most common ones: int for whole numbers (42), float for decimal numbers (3.14), str for text ("Hi") and bool for true or false (True / False).

The type() function gives you the type of a value. It is very useful for understanding an error.

print(type(42))
print(type(3.14))
print(type("Hi"))
print(type(True))

Start the lesson