I Got 99 Problems, But a Switch Ain't One 14/15


#1

def greater_less_equal_5(answer):
    if answer > 5:
        return 1
elif (answer) < 5:
    return -1
else:
    return 0

print greater_less_equal_5(2)
print greater_less_equal_5(4)
print greater_less_equal_5(6)

[Edit]


#2

Your indention looks a bit crazy.

def greater_less_equal_5(answer):
    if answer > 5:
        return 1
    elif answer < 5:
        return -1
    else:
        return 0

print greater_less_equal_5(2)
print greater_less_equal_5(4)
print greater_less_equal_5(6)

#3

thanks for the info I had gotten confused on this one


#4

I can't think of what to do in I Got 99 Problems, But a Switch Ain't One. Even my dad can't.