Python


#1


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

it prints out 1

i want it to print out -1


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


#2

Step 1.) says: On line 2, fill in the if statement to check if answer is greater than 5. notice in your function you have a parameter answer. Try using answer instead of greater_less_equal :thumbsup:


#3

Thanks :slight_smile:
i should have known that :sweat_smile:
it worked


#4

No problem! :smiley: Glad to have helped! It is a very tricky lesson and I have seen many just not realize so its too easy to do xD


#5

i don't really feel like i can do anything even after finishing these courses


#6

What do you mean exactly? Just confused about something in general or discouraged something ain't working out right?


#7

like in general, i cant think of anything productive to do.


#8

Well do you have goals set of things you want to do? Are you just bored with lessons in Python? Sometimes taking a break or trying something new or setting out a goal or project you want to work towards or create can elevate feelings of unproductive or no purpose.


#9

Thanks, I'll keep it in mind. yea i do have something i want to do.


#10

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