added problem 4 python solution