Skip to content

Instantly share code, notes, and snippets.

@bowbahdoe
Created February 21, 2014 01:20
Show Gist options
  • Select an option

  • Save bowbahdoe/9127023 to your computer and use it in GitHub Desktop.

Select an option

Save bowbahdoe/9127023 to your computer and use it in GitHub Desktop.
class Linker:
def __init__(self,name):
self.name = name
self.next = None
def setNext(self,nex):
self.next = nex
def getNext(self):
return self.next
def getName(self):
return self.name
henry = Linker("henry")
bob = Linker("bob")
bob.setNext(henry)
fernand = Linker("fernand")
fernand.setNext(bob)
current = fernand
while current.getNext() != None:
print(current.getName())
current = current.getNext()
print(current.getName())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment