The Big If HELP!


#1


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


Oops, try again. The following exception was raised when calling the_flying_circus(): RuntimeError: maximum recursion depth exceeded


I'm not sure.


def the_flying_circus():
#Make sure that the_flying_circus() returns True

    if the_flying_circus(): # Start coding here!
        print "hi"# Don't forget to indent  # Start coding 
        # the code inside this block!
    elif 11 + 11 == 22:
        print "lies"# Keep going here.
        # You'll want to add the else statement, too!
    else: 
        print "no"


#2

Reason..

You're calling function itself as if's condition


#3

Tho you need to understand you error then read these links...

Recursion
Maximum Recursion Depth


#4

Hi, I don't understand what I'm meant to write in this exercise as a whole.


#5

While writing your if statement , you need to put a boolean condition eg:3 > 6 , 23 == 56 but you're calling the function again and again (function is calling itself ) and thus it gives ya error!


#6

Hi, I don't understand what I'm meant to write in this exercise as a whole.

You need to write a function named the_flying_circus()
and inside the function's body ,you need to use if/else statement


#7

Um... can you give me a screenshot of what Im meant to do, so sorry.


#8

I will give you a hint as posting answers are against CC guidelines .

Hint**
Read the instruction of this excercise once again..Your code will look something like this..

def some_function():
    if condition1:
        # your code.
    elif condition2:
       # your code
    else: 
        # your code

#9

Oh, I got it now. Even though I don't understand it too much. I'll message you privately.


#10

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