# 1、佇列:FIFO先進先出 l=[] #入隊操作 l.append('first') l.append('second') l.append('third') print(l)#['first', 'second', 'third'] #出隊操作 print(l.pop(0))#first print(l.pop(0))#second print(l.pop(0))#third #2、堆疊:LIFO后進先出 l=[] #入堆疊操作 l.append('first') l.append('second') l.append('third') print(l)#['first', 'second', 'third'] #出隊操作 print(l.pop())#third print(l.pop())#second print(l.pop())#first
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/85029.html
標籤:Python
下一篇:Django ORM 多對多操作
