Permutation of first few integers in Python -
I want to go through all the permutations of Python (1,2,3,4,5) For some sort of calculation, such as
in the permutation lists for li: # Calculation list = [[1,2,3,4,5], [1,2,3,5] , 4], ...] Print Lei [0] - L [1] + Lee [2] -li [3] + Lee [4]
Through all these passages What would be a convenient way to iterate (As Ashwin Choudhary said in the comment: <2,3,4,5)?
/ P>
permutes = permutations of parameters to import ([1, 2,3,4,5]) permits in li: # do stuff
Comments
Post a Comment