Note that a variable can store values of different types throught a program. It is not constrained to the data type of the initial value we give it at creation:
a = "peanut"
type(a) # Output: <class 'str'>
a = False
type(a) # Output: <class 'bool'>
a = 13.7
type(a) # Output: <class 'float'>
Assignment
Follow the Coding Tutorial and let's practice with data types!
Hint
Look at the examples above if you get stuck.
Free plan: 30 tutor messages. PRO is unlimited.
Saved
Ctrl + Enter to check
