hw6 in python