from random import shuffle x = [[i] for i in range(10)] shuffle(x)
to randome a list, we use the shuffle method, which is a part of random python library
import randomnumber_list = [7, 14, 21, 28, 35, 42, 49, 56, 63, 70]print ("Original list : ", number_list)random.shuffle(number_list) #shuffle methodprint ("List after first shuffle : ", number_list)random.shuffle(number_list)print ("List after second shuffle : ", number_list)
import random
number_list = [7, 14, 21, 28, 35, 42, 49, 56, 63, 70]
print ("Original list : ", number_list)
random.shuffle(number_list) #shuffle method
print ("List after first shuffle : ", number_list)
random.shuffle(number_list)
print ("List after second shuffle : ", number_list)
Original list : [7, 14, 21, 28, 35, 42, 49, 56, 63, 70]
List after first shuffle : [7, 14, 56, 21, 35, 70, 49, 42, 28, 63]
List after second shuffle : [35, 63, 70, 21, 42, 28, 49, 56, 14, 7]