Created Python file for problem 2