I have the following code:
list =[]
list1 = ['Dublin', 'Kiev', 'Warsaw', 'Moscow']
for i in range(3):
random.shuffle(list1)
list.append(list1)
list
However, the output keeps the last shuffled value as:
[['Dublin', 'Moscow', 'Kiev', 'Warsaw'],
['Dublin', 'Moscow', 'Kiev', 'Warsaw'],
['Dublin', 'Moscow', 'Kiev', 'Warsaw']]
I'm really not sure what's happening, and why it behaves this way. Appreciate any replies.