Open jangjusung opened 2 years ago
from ast import Delete
class Mstack: def init(self) : self.stack=[] print("hi")
def push(self, int1): self.stack.append(int1) print(self.stack, type(int1),self.stack[-1]) def pop(self): return self.stack.pop() def length(self): return len(self.stack) def __del__ (self): print(self.stack,"소멸")
if name =='main': a1=Mstack() for x in range(1,6): a1.push(x) a1.pop() print('length: ',a1.length()) del a1
from ast import Delete
class Mstack: def init(self) : self.stack=[] print("hi")
if name =='main': a1=Mstack() for x in range(1,6): a1.push(x) a1.pop() print('length: ',a1.length()) del a1