Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. from linked_list import LinkedListException, LinkedList, Empty, Cell
  2.  
  3. def main():
  4.     # This is a short example for creating and using the linked list.
  5.     empty = Empty()
  6.     cell_1 = Cell('abc', empty)
  7.     cell_2 = Cell(56, cell_1)
  8.  
  9.     print(empty)
  10.     print()
  11.     print(cell_1)
  12.     print()
  13.     print(cell_2)
  14.     print()
  15.  
  16.  
  17.  
  18.     print(cell_2.nth(1))
  19.  
  20.     print("Index: {}".format(cell_2.index('abc')))
  21.  
  22.  
  23. if __name__ == '__main__':
  24.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement