Help me


#1

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

print greater_less_equal_5(4)
print greater_less_equal_5(5)
print greater_less_equal_5(6)

Just can't seem to grasp this i have tried every thing can someone post answer so i can understand it thank you first one i've struggled on seems so simple...


#2

Before I answer your question, I would like to state that in order for people to answer your question easier, use the "Preformatted text" button at the top of the text editor when you ask a question, it makes your code a lot easier to read!

With that said, as far as I can see, you don't have any condition for your "if" statement. It needs to have a condition in order to return something. Your code should look something like this:

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)

Ta-da! Hope this helps.


#3

i actually did this answer several times and only now its worked...