Weekly Python Exercise B3: Advanced topics 3 by Reuven M. Lerner