Update ex17.py

Trying to make the script shorter per the Study Drill #3