I got 99 problems but a switch ain't one


#1

I dont get it!!! nothing is working for me


5.14 ~ I've Got 99 Problems, Buy a Switch aint One
#2

Ok, lets look at the base code provided:

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

So all you have to do is fill in those two spots. First, the hint is:

On line 2, fill in the if statement to check if answer is greater than 5.

You need to use a comparison to determine if the answer provided is greater than 5.

Second:

On line 4, fill in the elif so that the function outputs -1 if answer is less than 5.

The exact same situation, you just need to determine if the answer provided is less than 5.

Here is the python documentation on comparisons:
https://docs.python.org/2/library/stdtypes.html#comparisons


#3

Hey guys, whats up... coding is awesome right!


#4

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