Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def append(self, value) -> None:
- # assign first node in curr
- curr = self._first
- # if curr is None, create new node
- if curr is None:
- self._first = Node(value)
- else:
- # tranverse nodes until next node is None
- while curr._next is not None:
- curr = curr._next
- curr._next = Node(value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement