【Python学习之旅】---队列回顾

 1 #创建队列
 2 import queue
 3 q=queue.Queue(maxsize=10)
 4 for i in range(10):
 5     q.put(i)  #往队列里面放值
 6 
 7 while not q.empty():  #当q不为空的时
 8     print(q.get())   #取出q的值
 9 a=2
10 
11 while a==1:
12     print("ok")
13 else:
14     print("不OK")

 

 

posted @ 2020-03-20 22:53  陈帅帅_大侠  阅读(98)  评论(0编辑  收藏  举报