I have five elements in a list variable (call it A). I want to represent every possible order for those five elements with each order being stored in another list as a list (call it B). If I append A to B then attempt to re-shuffle A to get a new order the previously stored list in B is also shuffled as it is assigned to A so after trying to produce the 25 different orders of the five elements of A, I get 25 of the same order in B. Is there a way that I can add A to B then shuffle A without shuffling the appended A in B?
Here is the basic code:
from random import shuffle
A = ["M1", "M2", "M3", "M4", "M5"]
B = []
for i in range(len(A) * 5):
shuffle(A)
temp = A
B.append(temp)
print (T)
Thanks