I've tried a few different things but nothing seems to work. COuld some one help me :)


#1

Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: invalid syntax (python, line 2)


def greater_less_equal_5(answer):
    if > 5:
        return 1
    elif < 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

In your logic you put:

>5
<5

What are you trying to compare to 5?

Right now your logic is incomplete.


#3

do i need to put an equation to complete it. I looked at some other topics and thats how some of them had it


#4

Their code is incorrect.

You must compare answer to 5.


#5

oh ok i got it Thx!

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


#6

You're Welcome!

Always post if you're confused. :slightly_smiling: