Im writing a program and I’ve run into an issue where I need the program to create lists on its own.
animals = ["cat", "dog", "rat", "horse"]
For example. Then, I want a function that list.appends list.
def append()
input = input(">>>")
animals.append(input)
When it does this, I want it to make a new list for the user input that is entered. Is there anyway to do this without having to use file functions?
The ultimate goal is for this function to:
- Append the list “animals” (Got that part)
- Then, I want it to create a new list that is unique to the input. The list might be referred to by the user input if at all possible.
- Lastly, I want this list to be editable by the user Which is easy with list.append. But I need to somehow then be able to refer to this unique list in order to do that.
Hope that clears up some confusion.
I hope I understood where you are aiming at. I suggest you use a
dictoflists: