Created
May 7, 2019 13:33
-
-
Save bubbobne/aa8a7a0c76c2dd185036516ec911aac3 to your computer and use it in GitHub Desktop.
python math
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 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