Completed ex20.py