What am I doing wrong?


#1

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

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

What am I doing wrong?


I Got 99 Problems, But a Switch Ain't One
#2

HI what error do you get?


#3

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!


#4

this part

if 5 > (answer) :
   return 1
elif 5 < (answer): 
   return -1

on the if condition put 5 < answer and on the else if condition put 5 > answer


#5

Like this?
if 5 > answer :
return 1
elif 5 < answer :
return -1

I get the same error


#6

No like this

if 5 < (answer) :
   return 1
elif 5 > (answer): 
   return -1