Good, I have a doubt with this that I can not think of how to do it, as the title says, I have a typical node and a typical list
class node:
def __init__(self, info):
self.info = info
self.next = None
class list:
def __init__(self):
self.__first = None
self.__last = None
and I have to create the function that inserts the node in the specific position of the given list (I put here what I have) (I do not want to change something of the node, nor create methods)
def indexar(self, info, indice):
longit = self.tam()
n = node(info)
p = self.__first
if index == 0:
self.__first = n
else:
if index > 0 and index < longit:
already create the function self.tam () that delivers the size of the list, and I already have in case you want to enter the position 0, but already for a non-initial X position I can not achieve it (rather, imagine it), any kind of help or recommendation is eternally grateful