Chapter 18: Operators, Keywords, and Variables
In Chapter 19, you learned about Python's core data types and how to store data in variables with type hints. Now it's time to learn what you can DO with that data using operators—the symbols that tell Python to perform actions.
Operators are the verbs of programming. In Chapter 19, you learned the nouns (data types). Now you learn the verbs (operators). In Chapter 22, you'll combine them into sentences (control flow).
🎯 Before You Begin
What You'll Learn
By the end of this chapter, you will:
- Perform calculations with arithmetic operators (
+,-,*,/,//,%,**) - Ask True/False questions with comparison operators (
==,!=,>,<,>=,<=) - Combine conditions with logical operators (
and,or,not) - Update variables with assignment operators (
=,+=,-=,*=,/=) - Recognize Python's 35 reserved keywords and avoid using them as variable names
- Build a complete calculator integrating all operator types with type validation
Operators are the verbs of programming. In Chapter 19, you learned the nouns (data types). Now you learn the verbs (operators). In Chapter 22, you'll combine them into sentences (control flow).