Updated ex18.py