I have a list of 2 lists, which are of equal size, in python like:
list_of_lists = [list1, list2]
In a for loop after doing some processing on both list1 and list2, I have to swap them so that list1 becomes list2 and list2 becomes a list initialized to all zeros. So at the end of the iteration the list_of_lists has to look like:
list_of_lists = [list1 which has contents of list2, list2 which has all zeros]
In C, one could just copy the pointers of list2 and list1 and then point list2 to a list initialized to all zeros. How do I do this in python ?