Print the Elements of a Linked List

  • + 0 comments
    def printLinkedList(head):
        current = head  
        while current:  
            print(current.data)
            current = current.next