1.实现栈
class Stask:
def __init__(self):
self.__stask = []
def pop(self):
return self.__stask.pop()
def get(self,string):
self.__stask.append(string)
def delete(self):
del self.__stask
2.运用栈
class Stask:
def __init__(self):
self.__stask = []
def pop(self):
return self.__stask.pop()
def get(self,string):
self.__stask.append(string)
def delete(self):
del self.__stask
s = Stask()
s.get("1")
print(s.pop())
3.导包
from queue import LifoQueue
以上就是今天的内容了,拜拜~