Python Challenge: my solution for the 5th question