Introduction
In this chapter, we’ll further our understanding of Booleans and Boolean expressions, learn about branching and flow control, and learn some convenient string methods.
Learning objectives
- You will learn more about Booleans, how to construct a truth table, and how to combine Booleans using the connectives
and
andor
. - You will learn how to write
if
, if/else, if/elif, and if/elif/else statements in Python, which allow program execution to follow different branches based on certain conditions. - You will learn how to represent decisions using and decision trees.
- You will learn a little about input validation.
- You will learn how to use convenient string methods such as
.upper()
,.lower()
, and.capitalize()
.
Terms and string methods introduced
- Boolean expression
- branching
.capitalize()
- comparison operator
- conditional
- De Morgan’s Laws
- decision tree
- falsiness
- lexicographic order
.lower()
- string method
- truth value
- truthiness
.upper()
Copyright © 2023–2025 Clayton Cafiero
No generative AI was used in producing this material. This was written the old-fashioned way.