《Python编程:从入门到实践》列表切片实践

《Python编程:从入门到实践》列表切片实践_第1张图片
4-10省略

4-11

my_pizzas = ["cheese","saussage","beef"]
friend_pizzas = my_pizzas[:]
my_pizzas.append("yogurt")
friend_pizzas.append("shit")
print("My favourite pizza are : " )
for pizza in my_pizzas:
    print(pizza + " pizza" + "\n")
print("My friend`s favourite pizza are : ")
for pizza in friend_pizzas:
    print(pizza + " pizza")

4-12省略

你可能感兴趣的:(《Python编程:从入门到实践》列表切片实践)