class Node:
def __init__(self, cargo=None, next=None):
self.cargo = cargo
self.next = next
def __str__(self):
return str(self.cargo)
if __name__ == '__main__':
node_1=Node(1)
node_2=Node(2)
node_3=Node(3)
node_1.next=node_2
node_2.next=node_3
def printList(node):
while node:
print node.cargo,
node = node.next
printList(node_1)