Print the Elements of a Linked List

  • + 9 comments

    Here is Python 3 implementation:

    def print_list(head):
        if head:
            print(head.data)
            print_list(head.next)