In my program, I have an input function which adds a string to a list with multiple other values. Is there a way to keep the input in the list as an item after the program has ended?
For example:
list = ['a', 'b', 'c']
addToList = input('Type string to add to list: ')
list.append(addToList)
If I added the string 'd' through the variable 'addToList', how could I make it so the 'd' would be an item in the list next time I ran the program
Would look like this:
list = ['a', 'b', 'c', 'd']
addToList = input('Type string to add to list: ')
list.append(addToList)