Skip to content

Instantly share code, notes, and snippets.

@Florian3k
Created December 12, 2017 21:37
Show Gist options
  • Save Florian3k/f885ee1c5af229c8dfb5b0eb50ac500d to your computer and use it in GitHub Desktop.
Save Florian3k/f885ee1c5af229c8dfb5b0eb50ac500d to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
from random import shuffle
def filter_list(lst, nums):
return list( filter( lambda x: x not in nums, lst ) )
excludes = [7,10,13]
sources = filter_list( range( 1, 32 ), excludes)
targets = sources[:]
shuffle(targets)
result = [
(7, 10),
(10, 7)
]
result.extend( zip( sources, targets ) )
result = sorted( result, key=lambda x: x[0] )
for i in result:
print(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment