I want each variable put into this function to then become the name of its own list.
def listy(x, insert):
listend = isinstance(x, list)
if listend:
x.append(insert)
else:
x = []
x.append(insert)
print(x)
listy("xyz", "neutral")
listy("xyz", "happy")
When I do this, though, it overwrites the previous list (ends up with the list just reading "happy" instead of "neutral", "happy"). How do I get it to append if that word is already the name of a list?