Decision Making

  • Kent D. LeeEmail author
Part of the Undergraduate Topics in Computer Science book series (UTICS)


The second chapter introduces the reader to making decisions in Python programs. The word “selection” refers to selecting between alternatives and the “if” statement in Python is how programmers perform selection in their programs.

Using if statements is a very important aspect of programming but can lead to very complicated and unwieldy programs. Chapter two shows the reader how to properly use if statements in their programs by demonstrating techniques for some common patterns. In particular, the guess and check pattern is introduced to students by examples and practice problems. Boolean (i.e. true and false) values and exception handling are also introduced in this chapter since they both are related to performing selection within a program.


Boolean Expression Statement Check Exception Handling Decimal Number Correct Output 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 7.
    The U.S. Consitution Online. Steve mount, 2010. [Online; accessed 1/29/2010;].
  2. 13.
    Wikipedia. George boole, 2010. [Online; accessed 1/29/2010;].

Copyright information

© Springer-Verlag London Limited 2011

Authors and Affiliations

  1. 1.Dept. Computer ScienceLuther CollegeDecorahUSA

Personalised recommendations