Created
April 5, 2020 20:46
-
-
Save yzdann/da4352d936fb9c3339081b611b9e5e2c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
num_list = [2, 4, 1, 6, 40, 2, 24, 3, 1, 5, 6, 8, 12, 9, 31, 45, 7, 14, 19, 20] | |
count = 5 | |
paritioned_list = [] | |
for i in range(count-1): | |
paritioned_list.append(num_list[i*count:(i+1)*count]) | |
two_d_4x4 = [ | |
list(set(first_list).intersection(second_list)) | |
for first_list in paritioned_list | |
for second_list in paritioned_list | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment