Why doesn't this code work?

Can not understand. My function is returning the True and False answers (as it have to be), but system is not recognizing it.

That’s because when two empty lists are passed in there is no return value, hence None. Empty lists don’t have an index and there is no range(0).

See if this helps…

    if lst1 + lst2 == []: return True
1 Like