#4.1想出三种es结尾的单词,遍历整个数组,打印出来
foods=['tomatoes','heores','potatoes']
'''for food in foods:
print(food)'''
#4.1修改4.1for循环,使其每一行显示一句话,但是包含其名称
for food in foods:
print("I like" ,food.title())
print("I like foods")
4.2练习
#4.2.1想出至少三种有共同特征的动物,将这些动物的名称存储在一个列表中,
# 再使用for循环将每种动物的名称都打印出
mammal=['dog','pig','cat']
for animal in mammal:
print(animal)
#4.2.2修改这个程序,使其针对每种动物都打印一个句子
for animal in mammal:
print("A",animal.title()," would make a great pet!")
#4.2.3在程序末尾添加一行代码,指出这些动物的共同之处
print("Any of these animals would make a great pet!")