Problem 20 solved (Python)