began to work on problem 3 in python