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


#1



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)


#2

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)


#3

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)


#4

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


#5

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)


#6

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


#7

thanks for your help


#8

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


#9

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)


#10

yeah i got that too ....................


#11

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


#13

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


#14

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


#15

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