def imprimeDeTrasParaFrente(lista):
if lista == None :
return
imprimeDeTrasParaFrente(lista.proximo)
print lista,
class Node(object):
def __init__(self, carga=None, proximo=None):
self.carga = carga
self.proximo = proximo
def __str__(self):
return str(self.carga)
no1, no2, no3 = Node(1), Node(2), Node(3)
no1.proximo, no2.proximo = no2, no3
imprimeDeTrasParaFrente(no1)
With the PrintFeatureFeature () function I was able to print the elements of the list in reverse order, and it only checks if the list is empty and calls itself with the next node in the list. In my perspective the print function is never called because when the list is empty the function simply returns and terminates the program, or am I wrong?