Help with monthy python exercise


#1

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

Error message:
File "python", line 3
if True and 3==3:
^
IndentationError: unexpected indent

My code:
 
def the_flying_circus(): True
    if True and 3==3:
        print "hello"
        
    elif 3>2 or 2==2:
        print "mack"
        
    else: 
        print "None of the above

`


#2

here:

def the_flying_circus(): True

why do you have True on this line? Its causing the error


#3

That's what I interpreted from the "Finally, the_flying_circus() must return True when evaluated." instruction.

So I got rid of that and there was still an error:

File "python", line 6
elif 3>2 or 2==2:
^
IndentationError: unindent does not match any outer indentation level"

Added another space before "elif" and "else" and I got another error: Oops, try again. the_flying_circus() returned the value None, did you forget to add a return statement?

So not sure if I actually improved anything by adding those spaces.


#4

can i see an updated version of your code?


#5

# Make sure that the_flying_circus() returns True
def the_flying_circus(): 
     if True and 3==3:
        print "hello"
        
     elif 3>2 or 2==2:
        print "mack"
        
     else: 
        print "None of the above"

#6

your function only prints, it also needs to return True

i don't get any syntax errors with your code


#7

Thanks it works now just figured that out exactly as you posted.


#8

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