#5.1 condition test
cars = ['subaru', 'bmw', 'jaguar', 'mercedes']
car = "toyota"
if car not in cars:
print("Sorry, you're wrong about the guess!")
print(23>21 and 21<12)
print(23/2 >10 or 23<12)
print('subaru' in cars)
print('toyota' not in cars)
print('toyota' in cars)
#5.2 more conditional tests
#skip it, unnecessary work.
#5.3 the color of alien_1
alien_color = 'green' or 'yellow' or 'red'
if alien_color is 'green':
print("You've made 5 points!")
if alien_color is 'pink':
print("You didn't earn the point!")
#5.4 the color of alien_2
if alien_color is "green":
print("You've earned 5 points!")
else:
print("You've earned 10 points!")
#5.5 the color of alien_3
if alien_color is "green":
print("You've earned 5 points!")
elif alien_color is "yellow":
print("You've earned 10 points!")
else:
print("You've earned 15 points!")
#5.6 the different ages of life
age = 26
if age < 2:
print("He is a baby.")
elif 2 <= age < 4:
print("He is learning to walk.")
elif 4 <= age < 13:
print("He is a child.")
elif 13 <= age < 20:
print("He is a teenager.")
elif 20 <= age < 65:
print("He is a adult.")
else:
print("He is an old man.")
#5.7 favorite fruits
fruits = ['apple', 'orange', 'banana', 'grape', 'pineapple', 'peach', 'waxberry']
favorite_fruits = fruits[0:3]
if 'apple' in favorite_fruits:
print("You really like apple!")
if 'orange' in favorite_fruits:
print('You really like orange!')
if 'waxberry' in favorite_fruits:
print("You really like waxberry!")
if "grape" in favorite_fruits:
print("You really like grape!)