I'm writing a function that will create a new shuffled list (I can't use the built-in shuffle function)
def Shuf(aList):
import random
newList=[]
for i in range(len(aList)):
element=random.sample(aList,1)
newList+=element
return newList
This is what I have right now and it's working but when I return the shuffled list there are repeated elements of my list. How can I make my function only return the elements in the list one time?