Specifically, I want to create a backup of a list, then make some changes to that list, append all the changes to a third list, but then reset the first list with the backup before making further changes, etc, until I'm finished making changes and want to copy back all the content in the third list to the first one. Unfortunately, it seems that whenever I make changes to the first list in another function, the backup gets changed also. Using original = backup
didn't work too well; nor did using
def setEqual(restore, backup):
restore = []
for number in backup:
restore.append(number)
solve my problem; even though I successfully restored the list from the backup, the backup nevertheless changed whenever I changed the original list.
How would I go about solving this problem?