99 Problems What am I doing wrong can someone give me the code and explain how they got it

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

<What do you expect to happen instead?>

```python

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

<do not remove the three backticks above>

you should indent your if, elif and else statemnt inside the the function greaterlessequal5() like that

def greaterlessequal5(answer):
    if condition:
        return 
    elif condition
        return 

edit:
and the name of your function should be greater_less_equal_5(answer)

2 Likes

This didn’t work for me

def greaterlessequal5(answer):
if condition:(>5):
return 1
elif condition (<5):
return -1
else:
return 0
print greaterlessequal5(4)
print greaterlessequal5(5)
print greaterlessequal5(6)

and the name of your function should be greater_less_equal_5(answer)

1 Like

this is my code:

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

print greaterlessequal5(4)
print greaterlessequal5(5)
print greaterlessequal5(6)

2 Likes

Hi you should change the name of your functon from greaterlessequal5() to greater_less_equal_5() in all your code

thanks for your help

def greater_less_equal_5(answer):
if answer >= 6:
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)

this is what i got

def greater_less_equal_5(answer):
if answer >= 6:
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)

yeah i got that too …

A post was split to a new topic: Having zero luck with this section

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)

can someone please help me i dont know what is wrong

and i have indented all my code too but it didnt show

The line has a colon between elif and answer that does not belong.