update ex8.py