ex16 should be run like this python ex16.py test.txt