function to print the linked list
def printList ( head ) : NEW_LINE INDENT if ( head == None ) : NEW_LINE INDENT return NEW_LINE DEDENT while ( head . next != None ) : NEW_LINE INDENT print ( head . data , " ▁ - > ▁ " , end = " " ) NEW_LINE head = head . next NEW_LINE DEDENT print ( head . data ) NEW_LINE DEDENT