Introduction

Published

2023-07-31

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 and or.
  • 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()

Original author: Clayton Cafiero < [given name] DOT [surname] AT uvm DOT edu >

No generative AI was used in producing this material. This was written the old-fashioned way.

This material is for free use under either the GNU Free Documentation License or the Creative Commons Attribution-ShareAlike 3.0 United States License (take your pick).