I am really lost on this one as well, I get the same error try again, just cannot seem to get it.
Think back on what you've learned about comparisons and conditional statements, such as
if..elif. The exercise starts with this skeleton:
def greater_less_equal_5(answer): if ________: return 1 elif ________: return -1 else: return 0
The instructions spell it out what we should be writing in place of the 'blanks' (the underscore lines need to be replaced with a comparison).
Give it a try and show us your code if it does not pass.
this is what I input, ive tried many options, answer gives back 1 1 1 none, -1 -1 -1 none, all saying output options is 0 or 1 (depending on original input) instead of -1 when asnwer is 3
if 4 > 5:
elif 5 < 5:
Okay, but what did the instructions ask us to do? Certainly not repeat the example in the lesson text. Give them another read:
On line 2, fill in the if statement to check if
answeris greater than 5.
On line 4, fill in the elif so that the function outputs -1 if
answeris less than 5.
Pay particular note to the parameter,
answer in the function definition. That is the variable the above instructions are alluding to.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.