fixed casting error in tut3.py