Python If-Else - Hacker Rank Solution