Conditionals and Control Flow: Else


#1



https://www.codecademy.com/courses/python-beginner-BxUFN/3/4?curriculum_id=4f89dab3d788890003000096#

I'm so lost here. Any help would be appreciated.

Error Message:
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!


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


#3

Instead of using a number greater or less than 5, use the parameter... answer.


#6

pls help me i gt the same error


#7

compare the parameter answer with number 5 like this
answer >5
answer<5


#8

Hey thanks for posting! I was stuck also after trying to get creative.


#11

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