Skip to content

Instantly share code, notes, and snippets.

@bubbobne
Created May 7, 2019 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bubbobne/aa8a7a0c76c2dd185036516ec911aac3 to your computer and use it in GitHub Desktop.
Save bubbobne/aa8a7a0c76c2dd185036516ec911aac3 to your computer and use it in GitHub Desktop.
python math
import itertools
# permutazioni
a = [2,4,6,8]
permutations = list(itertools.permutations(a))
# permutazioni per gruppi di 2
permutations = list(itertools.permutations(a,2))
# combinazioni
combinations = list(itertools.combination(a,2))
combinations = list(combinations_with_replacement(a,2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment