Fixed Problem 1 in Python

Solved logic error in the if statement