4-10切片
my_foods=['peach','grape','apple','jujube','dragon fruit']
print("The first three items in the list are:")
print(my_foods[:3])
print("Three items from the middle of the list are:")
print(my_foods[1:4])
print("The last three items in the list are:")
print(my_foods[-3])
4-11你的披萨和我的披萨
pizzas=['durian pizza','fruit pizza','super pizza']
friend_pizzas=pizzas[:]
pizzas.append("double pizza")
friend_pizzas.append("cheese pizza")
print("My favorite pizzas are:")
for flavor in pizzas:
print(flavor)
print("My friend favorite pizzas are:")
for flavor in friend_pizzas:
print(flavor)