利用python实现队列先进先出的功能

代码:

queue=[]
while 1:
    a=input("pleasse input something to queue,input 0 to break")
    if int(a)==0:
        break
    queue.append(a)
    
print("output the queue")
while len(queue):
    print(queue.pop(0))


运行截图:


python编程练习---队列的实现

相关文章:

  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2021-08-15
猜你喜欢
  • 2021-08-20
  • 2022-01-08
  • 2021-07-01
  • 2021-09-10
  • 2022-02-22
  • 2022-12-23
  • 2021-06-27
相关资源
相似解决方案