insertion in linked list inserting element in the linked list involvesreassigning the pointers from the existing nodes to the newly inserted node depending on whether the new data element is getting inserted at the beginning or at the middle or at the end of the linked listwe have the below scenarios inserting at the beginning this involves pointing the next pointer of the new data node to the current head of the linked list sothe current head of the linked list becomes the second data element and the new node becomes the head of the linked list class nodedef __init__(selfdataval=none)self dataval dataval self nextval none class slinkedlistdef __init__(self)self headval none print the linked list def listprint(self)printval self headval while printval is not noneprint (printval datavalprintval printval nextval def atbegining(self,newdata)newnode node(newdataupdate the new nodes next val to existing node newnode nextval self headval self headval newnode list slinkedlist(list headval node("mon" node("tue" node("wed"