为什么会输出3次pastrami

有没有哪个小伙伴知道,这个为什么会输出3遍pastrami啊。python初学者要哭了。

img

你明白你的代码是怎么运行的吗?for和if在此处的作用你都了解了吗?

这段代码是删除sandwich_orders中的pastrami,在删除前输出pastrami。sandwich_orders中有3个pastrami,所以就输出三次。

img