(self)
| 94 | curr_pos += 1 |
| 95 | |
| 96 | def display(self): |
| 97 | if self.head is None: |
| 98 | print("List is empty") |
| 99 | rev = [] |
| 100 | curr = self.head |
| 101 | while curr != None: |
| 102 | print(f"{curr.data} --> ", end="") |
| 103 | rev.append(curr.data) |
| 104 | curr = curr.next |
| 105 | print() |
| 106 | return rev[::-1] |