Page 176 - Beginning Programming with Pyth - John Paul Mueller
P. 176
The application displays the appropriate output message, as shown in Figure 8-6.
4. Repeat Steps 3 and 4, but type 5 instead of 1.
The application displays a different output message — the one
associated with the requested color.
5. Repeat Steps 3 and 4, but type 8 instead of 1.
The application tells you that you made an invalid choice.
6. Repeat Steps 3 and 4, but type Red instead of 1.
The application displays the expected error message, as shown in Figure 8-7. Any application you create should be able to detect errors and incorrect inputs. Chapter 10 shows you how to handle errors so that they’re user friendly.
FIGURE 8-6: Menus let you choose one option from a list of options.