Confusing instructions

#1

I got 99 problems but a switch aint one

the instructions are very vague, and the error message is also vague. "Oops, try again. 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!"

I'm not sure, it is vague.

``````def greater_less_equal_5(answer):
if greater_less_equal_5 > 5:
return 1
elif greater_less_equal_5 < 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 `def greater_less_equal_5(answer):` "answer" is the input that your function is taking and "greater_less_equal_5" is the name of the function.

When you run `print greater_less_equal_5(4)` "4" is the input into the function so in the function "answer" takes on the value of 4.

What your function needs to do is take the input, which is represented by "answer" and look to see if it's greater than 5 and if it is not than to see if(elif) it's less than 5, or if neither than to return 0.

#3

so where I wrote "greater_less_equal_5" I should write "answer"?

#4

Yes, that is correct!

#5

Thanks! god that was stupid haha. sometimes you just get stuck!

#6

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