Python If Else Hackerrank Solution For Java