Discuss / Python / 为什么是这结果

为什么是这结果

Topic source

君仁届什

#1 Created at ... [Delete] [Delete and Lock User]

```edibles = ["ham", "spam","eggs","nuts"] for food in edibles: if food == "spam": print("No more spam please!") break print("Great, delicious " + food) else: print("I am so glad: No spam!") print("Finally, I finished stuffing myself")

在此插入代码

```

老师~为甚么当food取到ham的时候结果是Great, delicious ham.而不是i am so glad:no spam


  • 1

Reply