The Big If (Printing)


#1

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

The code ran and it said I'd passed the course but I don't really understand this question. I don't remember covering returns and I don't understand why the code didn't print it to the console.

# Make sure that the_flying_circus() returns True
def the_flying_circus():
    if (230 != 23*10) and (False or True):
        print "The Flying Circus returns Trueish!"
        return True
    elif (263 != 23*10) and (not False and not False):
        print "The Flying Circus returns True!"
        return True
    else:
        print "The Flying Circus is a numpty!"
        return False

#2

return will be explained shortly.

To execute the function, you need to call your function


#3

so because all we were doing was defining the function not actually calling it, nothing is meant to happen?


#4

yep, the function won't execute inside the program unless you call it


#5

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