Program gives you more detailed explanation on operations of linked list. It will help students to understand the concepts of linked list and its working. It will help beginners to understand the concepts of inked list.

Operations we have performed are:

• Prepend
• Insert from tail
• Search a value
• Delete from tail
• Delete value
• Traversing
```class Node:
def __init__(self, data):
self.data = data
self.next = None
# Author : ITVoyagers Website : itvoyagers.in
def __init__(self):
self.tail = None
self.size=0

#....................................Insert value in begining...............................................
def prepending(self, data):
newnode=Node(data)
self.tail=newnode
else:
print("node inserted successfully with data ",data,"at the beginning")
self.size+=1
# Author : ITVoyagers Website : itvoyagers.in
#....................................Insert value from tail...............................................
def insertfromtail(self, data):
newnode=Node(data)
if self.tail ==None:
self.tail=newnode
else:
self.tail.next=newnode
self.tail=newnode
print("node inserted successfully with data ",data,"from the tail")
self.size+=1
# Author : ITVoyagers Website : itvoyagers.in
#....................................search a  value .....................................................
def search(self,value):
self.n = 0
while(current!=None):
self.n=self.n+1
if (current.data!=value):
current = current.next
else:
return True #if value is found
# Author : ITVoyagers Website : itvoyagers.in
else:
print("Deleted node is",value)
self.size-=1
#....................................Delete value from tail...............................................
def deletefromtail(self):
else:
while (current.next!=None):
prev=current
current=current.next
value=current.data
prev.next=None
print("Deleted node is",value)
self.tail=prev
self.size-=1
# Author : ITVoyagers Website : itvoyagers.in
# ....................................traversing value from tail...............................................
def deletevalue(self,value):
while (current!=None and current.data!=value):
prev=current
current=current.next
if current==None:
else:
self.size-=1
elif current== self.tail:
prev.next=current.next
self.tail=prev
else:
prev.next=current.next
print("deleted successfully")
# Author : ITVoyagers Website : itvoyagers.in
# ....................................traversing value from tail...............................................
def traversing(self):
while (current.next!=None):
print(current.data)
current=current.next
print(current.data)
#........................................................................................................................
print("1.Prepend n2.Insert from tail n3.Search a value n4.Delete from head")
print("5.Delete from tail n6.Delete value  n7.Traversing ")
while(ch!=8):
if ch==1:
value=int(input("enter a value to be inserted from head"))
k.prepending(value)
elif ch==2:
value=int(input("enter a value to be inserted from tail"))
k.insertfromtail(value)
elif ch==3:
value=int(input("enter a value to be searched"))
res=k.search(value)
if res == True:
print("Value is",value)
else:
elif ch==4:
elif ch==5:
k.deletefromtail()
elif ch==6:
value=int(input("enter a value to be deleted"))
k.deletevalue(value)
else:
k.traversing()
# Author : ITVoyagers Website : itvoyagers.in

```

Output :

```Menu
1.Prepend
2.Insert from tail
3.Search a value
5.Delete from tail
6.Delete value
7.Traversing
enter a value to be inserted from head3
node inserted successfully with data  3 at the beginning