[SOLVED]It looks like your function output 1 instead of -1 when answer is 3. Make sure you filled in the if and elif statements correctly!


#1



I dont know how to delete this post. Solved my own question in about a minute. No need to answer this. Thanks
output is:
1
-1
0

but I keep getting : It looks like your function output 1 instead of -1 when answer is 3. Make sure you filled in the if and elif statements correctly!
This is my code at the bottom:

def greater_less_equal_5(answer):
    if answer<5:
        return 1
    elif answer<=5:          
        return -1
    else:
        return 0
        
print greater_less_equal_5(4)
print greater_less_equal_5(5)
print greater_less_equal_5(6)


#2

hi. how were you able to solve this?


#3

if answer > 5:

elif answer < 5:

I hope I was helpfull.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.