Lucas Soares
Apr 14, 2021

--

from itertools import permutations

perm = list(permutations([1,2,3]))

Output:

[(1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)]

Thanks Drew! :)

--

--

Lucas Soares
Lucas Soares

Written by Lucas Soares

AI Engineer. I write about AI | Tools| Data Science | Productivity. Subscribe to my Youtube channel: https://www.youtube.com/@automatalearninglab/videos

Responses (1)