print the linked list def listprint(self)printval self headval while printval is not noneprint (printval datavalprintval printval nextval list slinkedlist(list headval node("mon" node("tue" node("wed"list headval nextval nextval list atend("thu"list listprint(when the above code is executedit produces the following resultmon tue wed thu inserting in between two data nodes this involves changing the pointer of specific node to point to the new node that is possible by passing in both the new node and the existing node after whichthe new node will be inserted sowe define an additional class which will change the next pointer of the new node to the next pointer of middle node thenassign the new node to next pointer of the middle node class nodedef __init__(selfdataval=none)self dataval dataval self nextval none class slinkedlist