Data Types
Variables can be set to many different types of data besides just numbers and strings. Some of the most common data types are str
, stands for string, int
, stands for integer, float
, stands for a number with a floating point, list
, tuple
, range
, dict
, stands for dictionary, and bool
, which stands for boolean.
Type: str
Strings contain text. They will print exactly what you type. However, here are a few tricks you can use to type them in different ways depending on your use for them.
Type: int and float
Integers are numbers without decimals that can range from -2147483648 to 2147483647. Floats have a greater range from 1.8 x 10-308 to 1.8 x 10308. Since Python dynamically changes variable types, it's not necessary to specify which you are using.