1def deleteAllNodes(self):
2
3 #1 & 2. create a temp node, if the head is not
4 # null make temp as head and move head to head
5 # next, then delete the temp, continue the
6 # process till head becomes null
7 while (self.head != None):
8 temp = self.head
9 self.head = self.head.next
10 temp = None
11
12 print("All nodes are deleted successfully.")