If Else In Python Hackerrank Solution