Hackerrank Python If Else Solution