(self)
| 28 | self.top = self.top.next |
| 29 | |
| 30 | def printData(self): |
| 31 | print("Printing stack: ") |
| 32 | |
| 33 | # Step through the stack and print values |
| 34 | tmp_node = self.top |
| 35 | |
| 36 | while tmp_node != None: |
| 37 | print (f"[{tmp_node.data}]", end = "") |
| 38 | tmp_node = tmp_node.next |
| 39 | |
| 40 | print("") |
| 41 | |
| 42 | stack = Stack() |
| 43 | stack.push('a') |