I have stack code:
class Stack:
def __init__(self):
self.__data = []
def empty(self):
return len(self.__data) == 0
def size(self):
return len(self.__data)
def push(self, x):
self.__data.append(x)
def pop(self):
return self.__data.pop()
and adds numbers 1, 2:
stack = Stack()
stack.push(1)
stack.push(2)
and I don't know how to print __data list?
so that it shows 1,2 in the list?
[1,2]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…