Skip to content

Instantly share code, notes, and snippets.

@MSWon
Created January 8, 2019 10:33
Show Gist options
  • Save MSWon/4007c4eb1cef93c78b984dde6af621d6 to your computer and use it in GitHub Desktop.
Save MSWon/4007c4eb1cef93c78b984dde6af621d6 to your computer and use it in GitHub Desktop.
shuffle two list in same order
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment