Python If Else Hackerrank Solution Python