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



-----------------------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
        return 0
print greater_less_equal_5(4)
print greater_less_equal_5(5)
print greater_less_equal_5(6)


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.


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