Skip to content

Instantly share code, notes, and snippets.

@chamix
Created November 1, 2014 12:51
Show Gist options
  • Save chamix/b7fae83450baec0a3e35 to your computer and use it in GitHub Desktop.
Save chamix/b7fae83450baec0a3e35 to your computer and use it in GitHub Desktop.
def combination (n, m):
combs = [(x, y) for x in range() for y in range(m) if x != y]
#combs.extend([(x, y) for x in range(m) for y in range(n) if x != y])
for comb in combs:
print(comb, end='\n')
combination(3, 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment