【发布时间】:2019-03-03 04:08:19
【问题描述】:
class stack:
def __init__(self)
def stacksize(self):
Size=len(self.stack)
Print ('size is', size)
返回 大小为 4 #假设列表大小为 4 无
以及如何访问该堆栈中最顶部的元素
【问题讨论】:
-
您尚未将任何对象分配给堆栈。该函数返回 None 因为您没有从该函数返回任何内容
标签: python python-2.7 stack