modified:   ex3.py