Python 7 Programming Tutorial - if elif else

age = 27

if age < 21:
    print("No beer for you!")


name = "Tommy D"

if name is "Bucky":
    print("Hey there Bucky")
elif name is "Lucy":
    print("What up Lucedawg?")
elif name is "Sammy":
    print("What up Slammy?")
else:
    print("Please sign up for the site!")

你可能感兴趣的:(Python 7 Programming Tutorial - if elif else)