Practical Programming, Third Edition: Incorrect Answer in Chapter 5 Exercise Solution

The answer to 3rd Problem of Chapter 5 (Making Choices) of “Practical Programming, Third Edition” seems incorrect in the given answer key at [http://media.pragprog.com/titles/gwpy3/Exercises/Chapter5.pdf].

The question asks to write a condition which should produce True if and only if at most one of the variables is True.

Considering the situation when both variables are False (fulfilling the given criterion), the expression provided in the answer key, when evaluated, results in False value instead of True .

Either the condition could be changed to "write a condition which should produce True if and only if exactly one of the variables is True to accommodate the given solution or the solution itself be changed.

One possible concise solution to that problem would be:

( not (full and empty)).

Kindly correct that errata. Thank you.

2 Likes