Created
January 8, 2019 10:33
-
-
Save MSWon/4007c4eb1cef93c78b984dde6af621d6 to your computer and use it in GitHub Desktop.
shuffle two list in same order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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