Data Types, Variables & Operators
Data Types, Variables & Operators: The Building Blocks 🧱
Now that you can show messages and read them back, it's time to actually do something with the information — store it, check what kind of value it is, convert it, do math with it, and compare it.
This unit covers:
- Variables — storing and reassigning values
- Data types — the different kinds of values Python works with (
int,float,str,bool,list,dict), and converting between them - Operators — arithmetic (
+ - * / // % **), comparison (== != < > <= >=), and logical (and or not)
We'll cover data types first, since knowing what kind of value you're working with is what makes the rest of this make sense. By the end, you'll be able to store information, understand its type, transform it, and make decisions about it — everything you need before we get to if statements and loops.
# problems
1Reassigning a Variable
Easy
2Data Types: int and float
Easy
3Data Types: str and bool
Easy
4Data Types: list
Easy
5Data Types: dict
Easy
6Accessing List and Dictionary Data
Easy
7Modifying List and Dictionary Data
Medium
8Converting Between Types
Easy
9Why Types Matter: Mixing Text and Numbers
Medium
10Doing Math: + - * /
Easy
11Floor Division and Remainder
Easy
12Powers with **
Easy
13Order of Operations
Easy
14Shortcut Assignment: += -= *= /=
Easy
15Comparing Values
Easy
16Combining Conditions: and / or / not
Easy
17String Operators: +, *, and len()
Easy