class stack():
list = [ ]
def isEmpty(self):
return not list
def push(self,x):
#对父类属性进行修改
stack.list.insert(0,x)
#单独运行脚本return不会显示stack.list,在交互模式下会直接显示
return stack.list
def Pop(self,x):
stack.list.pop(x)
def Top():
list[0]
def bottom():
list[-1]
python039(关于继承和return)
于 2018-10-03 23:03:51 首次发布