Completed 4-2 Animals
This commit is contained in:
parent
23a41bbd1a
commit
50876dd94b
16
Chapter_04/4-2_animals.py
Normal file
16
Chapter_04/4-2_animals.py
Normal file
@ -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!")
|
||||
Loading…
x
Reference in New Issue
Block a user