Added solution to problem 50 in python.