[Solved] How to do random shuffling in Python?
random.shuffle is your friend, according to the docs random.shuffle(x[, random]) . Shuffle the sequence x in place. import random #Convert string to list of chars li = list(‘ABDEB’) for i in range(5): #Shuffle the list, the last shuffled list is shuffled every time random.shuffle(li) #Convert list to string again and print print(”.join(li)) Output might look … Read more