code ex1.py