Beginner·5 min·basics · types
Variables & Types
Variables & Types
Python figures out the type for you, but you should still know what you're holding.
The basics
- int — whole numbers (
27) - float — decimals (
1.78) - str — text (
"Ada") - bool —
TrueorFalse
type(x).__name__ tells you what type a value is.
Try it
- Add a
cityvariable and print it. - What happens if you add
age + height? Does the type change?