Instructions On line 2, fill in the if statement to check if answer is greater than 5. On line 4, fill in the elif so that the function outputs -1 if answer is less than 5. ? python def greater_less_equal_5(answer): if ________: ....................(line 2) return 1 elif ________: ......................(line 4) return -1 else: return 0 print greater_less_equal_5(4) print greater_less_equal_5(5) print greater_less_equal_5(6)
Okay, show us what you've tried, so we guide you way-up.
if greater_less_equal_5 > 5:
elif greater_less_equal_5 < 5:
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 4)
not too sure what to do again cos i have tried other methods buts its not working
Okay. Thank you for providing all these.
Now, the first (line 2) is to check if answer is greater than 5. So, you should be using your parameter, answer and not the function again.
if answer > 5:
Follow this trend through.
I hope this helps!
wow thanks a lot ... i did work!!
Have fun coding!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.