From f09c5f103cec3d3764ef89ded2a0ce0d62323fe7 Mon Sep 17 00:00:00 2001 From: cheeks <134818917+leftovertoast@users.noreply.github.com> Date: Fri, 24 Jan 2025 18:03:20 -0500 Subject: [PATCH] Completed 5-7 Favorite Fruit --- Chapter_05/5-07_favorite_fruit.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Chapter_05/5-07_favorite_fruit.py diff --git a/Chapter_05/5-07_favorite_fruit.py b/Chapter_05/5-07_favorite_fruit.py new file mode 100644 index 0000000..59a8dcf --- /dev/null +++ b/Chapter_05/5-07_favorite_fruit.py @@ -0,0 +1,16 @@ +# 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") + \ No newline at end of file