Big if cant get the right code


#1

Hello guys, im new in this coding world, never done anything like this before, Im trying my best to learn by myself, can you guys check what i just did, i know you guys my find obvious errors in there for you but im new never done this before so please be pacient. ty

# Make sure that the_flying_circus() returns True
def the_flying_circus():
    if 8 > 5 and not False or False:    # Start coding here!
        Print "I love traveling"
        Return True
        # Don't forget to indent
        # the code inside this block!
    elif 2 == 2 and True =! False:
        Print "I dont love traveling"
        Rreturn True   
        # Keep going here.
        # You'll want to add the else statement, too!
    Else:
        Print "I want to sleep"
        Return True
the_flying_circus()

#2

First off, Return should always be written, return; and, Print always written, print. Keywords are never capitalized. Same applies to Else => else.

False and True are not keywords, but boolean primitives, so this above rule does not apply to them.

Check your work for typos, and if the print statements are not asked for or expected do not include them in your submitted code. After you pass the lesson the you can go to town with experimenting.


#4
# Make sure that the_flying_circus() returns True
def the_flying_circus():
    if 8 > 5 and 15**3>25 :    # Start coding here!
        print "I love traveling"
        return True
        # Don't forget to indent
        # the code inside this block!
    elif 2 == 2 and 25/2>10:
        print "I dont love traveling"
        return True   
        # Keep going here.
        # You'll want to add the else statement, too!
    else:
        print "I want to sleep"
        return True
the_flying_circus()  

Worked. thank you so much


#5

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