I need some help ,I'm a greenhorn ,Thanks


#1



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


1
1
1
None
-----------------------I just don't know what should I do.


I can't get it like it should be....


Replace this line with your code. 
def greater_less_equal_5(answer):
    if 6>5:
        return 1
    elif False:          
        return -1
    else: 
        return 0
        
print greater_less_equal_5(4)
print greater_less_equal_5(5)
print greater_less_equal_5(6)


#2

Hi @506872035 ,

Here, you have defined answer as the parameter to the greater_less_equal_5 function, which is good ...

def greater_less_equal_5(answer):

Now the function needs to use the number that is passed to the function via answer to do its work. That consists of comparing answer to 5. Instead, you have compared 6 to 5 here ...

if 6>5:

In your elif header, you have False as the condition ...

elif False:

The condition there should instead determine whether answer is less than 5.

The else block is fine, as you have it now.


#3

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