I have the following code but Python keeps saying "local variable 'a' referenced before assignment"
def inter(X,Y):
if pertenece(cabeza(X),Y):
a = lista(cabeza(X),inter(cola(X),Y))
elif vacia(cola(X)): return a
else: inter(cola(X),Y)
I have no idea why I'm getting this error since I have defined 'a' before referencing it. Please help.
The functions 'pertenece', 'cabeza', 'cola', 'vacia' and 'lista' where all previously defined and have no issue.