The 99 problems issue thing by Ariana Grande


#1

@chipjumper36731 i tagged you cause it would take forever for a reply anyway lol


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


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


#2

Haha nice title @xxserpentsxxyt. Your problem is that you never user the "answer" parameter in your function. Also, the else statement usually stays blank like this:

else:
        return +5

Your "answer" variable is the number you input each time for the function to use, so it needs to be used in the actual function. ALWAYS use the parameter in the function. The right code is this:

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

Hope that helps! :slight_smile:

-- @chipjumper36731


#3

Ty and ty i hope i can get past it lol


#4

Did it work for you?


#5

i can't tell i mighta done it wrong

Make sure that the_flying_circus() returns True

def the_flying_circus(answer):
if 5 = 5 print FlyingCircus:

    # the code inside this block!
elif 7 = 7: print TheFlyingCircusHehe
    # Keep going here.
else:
        return  +5

FlyingCircus = 556666
TheFlyingCircusHehe = 666655
printthis = Finally Done?


#6

I just took away the variables i used for printing but that didn't work either.


#7

then i went to this

Make sure that the_flying_circus() returns True

def the_flying_circus(answer):
if 5 = 5:

    # the code inside this block!
elif 7 = 7:
    # Keep going here.
else:
        return  +5

#8

Remember the difference between = and == ?


#9

not much its equal to and uhh


#10

For your reference:

= (assignment operator) is used to assign a value to a variable, element of an array, or property of an object
== (equality operator) is used to compare two values or expressions


#11

still isn't working right i fixed the == it still says check the console for the error


#12

Alright you missed the point if what I said, your if statements should always be in this format:

    if answer > 5:
        return 1
    elif answer < 5:          
        return -1
    else:
        return 0

#13

So fix your formatting for your code, and remove the spaces between them. If you want, then you can copy and paste my format, and fill in the blanks as needed for the exercise.


#14

whats the exception error?


#15

do i put answer in the () and after the semi colon : put the answer? or i leave that


#16

You put the answer before the semicolon. Can you give me a link to the exercise?


#17

yeah sure

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


#18

wait you put the word answer before the semi colon : or you put the number answer?


#19

Alright I'll give you my code but, I want you to understand it before moving on:

# Make sure that the_flying_circus() returns True
def the_flying_circus(): 
    
    if (the_flying_circus==5) or (the_flying_circus< 10) :
        print "True"
    
    elif (the_flying_circus >10 or the_flying_circus!= 5) :
        print "False"
 
    else: 
        print "HELP"
    return True

This exercise didn't need a parameter. Sorry for the mistake.


#20

I suggest you must read and follow carefully the instructions:

First. if, elif, and else statements;
-yep, you wrote an if elif else statement

Second. At least one of and, or, or not
-the second instruction asking you to use any of the operators above on your condition

Third. A comparator (==, !=, <, <=, >, or >=)
-you need to use Python Comparison Operators to compare two values