#!/usr/bin/python3
#建立链表类和遍历此链表
class Node():
def init (self,data=None):
self.data=data
self.next=None
class LinkedList():
def init (self):
self.head=None
def printList(self):
ptr=self.head
while ptr:
print(ptr.data)
ptr=ptr.next
link=LinkedList()
link.head=Node(5)
n2=Node(15)
n3=Node(25)
link.head.next=n2
n2.next=n3
link.printList()