Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. def append(self, value) -> None:
  2. # assign first node in curr
  3. curr = self._first
  4. # if curr is None, create new node
  5. if curr is None:
  6. self._first = Node(value)
  7. else:
  8. # tranverse nodes until next node is None
  9. while curr._next is not None:
  10. curr = curr._next
  11. curr._next = Node(value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement