16 lines
517 B
Python
16 lines
517 B
Python
# Exercise 5-7 Favorite Fruit
|
|
# Learning Objective: Write five if statements based on a list of favorite fruits.
|
|
|
|
favorite_fruits = ['apples', 'pears', 'bananas']
|
|
|
|
if 'bananas' in favorite_fruits:
|
|
print('You really like bananas!')
|
|
if 'pears' in favorite_fruits:
|
|
print('You really like pears!')
|
|
if 'apples' in favorite_fruits:
|
|
print('You really like apples!')
|
|
if 'strawberries' in favorite_fruits:
|
|
print('You really like strawberries')
|
|
if 'blueberries' in favorite_fruits:
|
|
print("You really like blueberries")
|
|
|