class Node: def __init__(self, value): self.value = value self.next = None # Build the list 10 -> 20 -> 30 manually head = Node(10) head.next = Node(20) head.next.next = Node(30) print(head.value, head.next.value, head.next.next.value) # 10 20 30
Click Run to execute this code.