Solved the first challenge in python.