(self, num_of_loops=1)
| 40 | self.stack = [item] + self.stack |
| 41 | |
| 42 | def pop(self, num_of_loops=1): |
| 43 | x=[] |
| 44 | curr_loop=0 |
| 45 | while curr_loop < num_of_loops: |
| 46 | try: |
| 47 | x, self.stack = x + [self.stack[0]], self.stack[1:] |
| 48 | except: |
| 49 | pass #return "error: stack underflow" |
| 50 | curr_loop += 1 |
| 51 | return tuple(x) |
| 52 | |
| 53 | def empty(self): #returns true if stack is empty |
| 54 | return not self.stack |