Python If Else Hackerrank Solution C