def createNode(self, val): node = Node() node.setVal(val) node.setNext(None) return node
def push(self, ele): temp = ListNode() temp.setVal(ele) temp.setNext(self.top) self.top = temp
def createNode(self, val): node = Node() node.setVal(val) node.setNext(None) return node
def push(self, ele): temp = ListNode() temp.setVal(ele) temp.setNext(self.top) self.top = temp