python if else program hackerrank solution