Nesting Blocks : If : Statement PYTHON TUTORIALS


PYTHON TUTORIALS » Statement » If »

 

Nesting Blocks


name = raw_input('What is your name? ')

if name.endswith('Gumby'):
    if name.startswith('Mr.'):
        print 'Hello, Mr. Gumby
    elif name.startswith('Mrs.'):
        print 'Hello, Mrs. Gumby
    else
        print 'Hello, Gumby'
else
    print 'Hello, stranger'



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Statement
» If