Guided Notes
Data Types & Variables
Integers, floats, strings, booleans, type(), and converting between them.
Every value has a type
Slide 1 / 5Informally we say "number" or "text", but Python has precise names for each kind of value ā and the type decides what you can do with it.
Ask for any value's type with the built-in type() function:
type(0) ā int type(19.95) ā float type("Spam") ā str type(True) ā bool
| Type | What it holds | Examples |
|---|---|---|
| int | Whole numbers | 0, 42, -7 |
| float | Numbers with a decimal point | 19.95, 0.5, -3.0 |
| str | Text | "Spam", 'Ada' |
| bool | True or False | True, False |
