Python If Else Hackerrank Solution