list python shuffling

56

list python shuffling -

import random

l = list(range(5))
print(l)
# [0, 1, 2, 3, 4]

random.shuffle(l)
print(l)
# [1, 0, 4, 3, 2]

Comments

Submit
0 Comments