Python implementation randomly ordered
Use shuffle () function to achieve a random sort the list
from random import shuffle
name = ["a", "b", "c","d", "e"]
shuffle(name)
for i in name:
print(i)
for i, j in enumerate(name):
name[i] = (i + 1).__str__() + ':' + j.__str__()
print("---随机顺序---")
for i in name:
print(i)
Run results shown in Figure: