I Got 99 Problems, But a Switch Ain't One pls help


#1

def greater_less_equal_5(answer):
if > 5:
return 1
elif > 5:
return -1
else:
return 0

print greater_less_equal_5(4)
print greater_less_equal_5(5)
print greater_less_equal_5(6)

Error:
File "python", line 2
if 5 < :
^
SyntaxError: invalid syntax

This is my code , but it gives this error , I do not know what to do help !!


#2

@jewelzowl

Hi, what are you comparing right now? The answer??? Try this:

if answer > 5:
``` 

```
elif answer < 5:

#3

Right now you are comparing absolutly nothing to 5, so it doesn't know what you're talking about. You need to compare answer to 5, like so... if answer > 5:


#4

Thank you so much already figured out , I am grateful!:slight_smile:


#5

try this ..line 2 answer >5
elif answer < 5