I'm trying to design a function for encryption that shuffles an array in a custom order using a key as shown below:
arr = ["a","b","c","d","e"]
key = [0,1,4,3,2]
arr2 = arr
for i in range(len(arr)):
arr[i]= arr2[key[i]]
print(arr)
problem is, at the moment, the arr2 (which i made as a reference point for the program) changes every time arr changes. Does anyone know how to fix this?