my solution to Think Python, exercise 3.1

I’m going through Think Python, by Allen Downey, for the time being, likely until classes begin for me at the end of the month.

Thank you, Dr. Downey, for making it available free online.

3-17-2021 Update: I’m finding I prefer aspects of the version of the document headed by Peter Wentworth, How to Think Like a Computer Scientist: Learning with Python 3, compared to Downey. The Wentworth version has more thorough explanations and examples.

Of note, the Wentworth examples have dated pop culture references (e.g., Brad and Angelina), whereas Downey relies mostly on Monty Python.

Of more relevant note, (another) disadvantage of the Wentworth version is that it has no answers to the exercises at the end of the chapters; Downey provides answers to some, but not all, of his exercises, which are different that the Wentworth exercises. Downey’s questions, however, have been getting increasingly complex, beyond the scope of the information presented in the chapters.

At present, I’m using both versions in my review of the subject matter, though I wouldn’t mind yet another edition that combined the best elements of both (according to me).