hw3 in python