Completed ex10.py