Driver Code
llist = LinkedList ( ) NEW_LINE for i in range ( 8 , 0 , - 1 ) : NEW_LINE INDENT llist . push ( i ) NEW_LINE DEDENT llist . printList ( ) NEW_LINE for i in range ( 1 , 9 ) : NEW_LINE INDENT llist . swapKth ( i ) NEW_LINE print ( " Modified ▁ List ▁ for ▁ k ▁ = ▁ " , i ) NEW_LINE llist . printList ( ) NEW_LINE print ( " " ) NEW_LINE DEDENT