Solving the python challenge