https://medium.com/@gmlearnstech/day-45-tackling-python-challenges-in-cs50ps-problem-set-4-question-4-bca6e6bfcb88