Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python jointly shuffle list

import random

a = ['a', 'b', 'c']
b = [1, 2, 3]

c = list(zip(a, b))

random.shuffle(c)

a, b = zip(*c)

print a
print b

[OUTPUT]
['a', 'c', 'b']
[1, 3, 2]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #jointly #shuffle #list
ADD COMMENT
Topic
Name
3+9 =