【发布时间】:2020-05-27 09:03:08
【问题描述】:
假设我有一个队列,
queue = [1]
当我运行一个while循环时
while queue:
queue.pop(0)
print("Hello World")
为什么这段代码没有终止并输出 hello world?
【问题讨论】:
-
你能编辑你的问题并显示输出吗?
-
它对我有用。它应该只运行一次,因为
queue只包含一个元素。
标签: python list python-2.7