python shuffle 2 lists together code example
Example 1: python shuffle list
import random
number_list = [7, 14, 21, 28, 35, 42, 49, 56, 63, 70]
print ("Original list : ", number_list)
random.shuffle(number_list)
print ("List after shuffle : ", number_list)
Example 2: python shuffle two lists in the same way
import random
your_list_1 = ['the', 'original', 'order']
your_list_2 = [1, 2, 3]
joined_lists = list(zip(your_list_1, your_list_2))
random.shuffle(joined_lists)
your_list_1, your_list_2 = zip(*joined_lists)
print(your_list_1)
print(your_list_2)
--> ('the', 'order', 'original')
--> (1, 3, 2)