Weekly Python Exercise B1: Advanced topics 1 by Reuven M. Lerner