From 50876dd94bfb56db68e3a6cae7e9765477238074 Mon Sep 17 00:00:00 2001 From: cheeks <134818917+leftovertoast@users.noreply.github.com> Date: Mon, 20 Jan 2025 23:21:41 -0500 Subject: [PATCH] Completed 4-2 Animals --- Chapter_04/4-2_animals.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Chapter_04/4-2_animals.py diff --git a/Chapter_04/4-2_animals.py b/Chapter_04/4-2_animals.py new file mode 100644 index 0000000..e68edec --- /dev/null +++ b/Chapter_04/4-2_animals.py @@ -0,0 +1,16 @@ +# Exercise 4-2 Animals +# Learning Objective: Same as 4-1, utilize for loop. + +animals = ['dog', 'cat', 'ferret'] + +''' +for animal in animals: + print(animal) +''' + +#modified: + +for animal in animals: + print(f"A {animal} would make a great pet. \n") + +print("These animals all have 4 legs and make great pets!") \ No newline at end of file