# 5-3
alien_color = "green"
if alien_color == "green":
print("You got 5 point")
alien_color = "red"
if alien_color == "green":
print("You got 5 point")
#5-4
alien_color = "red"
if alien_color == "green":
print("You got 5 point")
else:
print("You got 10 point")
alien_color = "green"
if alien_color == "green":
print("You got 5 point")
else:
print("You got 10 point")
#5-5
alien_color = "green"
if alien_color == "green":
print("You got 5 point")
elif alien_color = "yellow":
print("You got 10 point")
elif alien_color = "red":
print("You got 15 point")
alien_color = "red"
if alien_color == "green":
print("You got 5 point")
elif alien_color = "yellow":
print("You got 10 point")
elif alien_color = "red":
print("You got 15 point")
alien_color = "yellow"
if alien_color == "green":
print("You got 5 point")
elif alien_color = "yellow":
print("You got 10 point")
elif alien_color = "red":
print("You got 15 point")
#5-6
age = 19
if age < 2:
print("He is a baby")
elif age < 4:
print("He is learning to walk")
elif age < 13:
print("He is a child")
elif age < 20:
print("He is a teenager")
elif age < 65:
print("He is an adult")
else:
print("He is a old man")
#5-7
favorite_fruits = ["apples", "bananas", "oranges"]
if "apples" in favorite_fruits:
print("you really like apples")
if "bananas" in favorite_fruits:
print("you really like bananas")
if "oranges" in favorite_fruits:
print("you really like oranges")
if "mellons" in favorite_fruits:
print("you really like mellons")
if "pears" in favorite_fruits:
print("you really like pears")
#5-8
usernames = ["admin", "bob", "alice", "david", "john"]
for user in usernames:
if user == "admin":
print("Hello {}, would you like to see a status report?".format(user))
else
print("Hello {}, thank you for logging in again".format(user))
#5-9
usernames = ["admin", "bob", "alice", "david", "john"]
usernames = []
if len(usernames) == 0:
print("We need to find some users!")
for user in usernames:
if user == "admin":
print("Hello {}, would you like to see a status report?".format(user))
else
print("Hello {}, thank you for logging in again".format(user))
#5-10
current_users = ["admin", "bob", "alice", "david", "john"]
new_users = ["bob", "john", "cindy", "daicy", "bill"]
for new_user in new_users:
if new_user in current_users:
print("Username {} is already exist, please change another one.".format(new_user))
else:
print("This username is valid")