about | help | code help+videos | done | prefs |
permutations
Define permutations(items) to return a list of all the possible permutations (different orderings) of the items. items will be a list, and the result of permutations(items) will be a list of lists, where each one has all the elements of items, but in different order. permutations(['A', 'B', 'C']) → [['A', 'B', 'C'], ['B', 'A', 'C'], ['B', 'C', 'A'], ['A', 'C', 'B'], ['C', 'A', 'B'], ['C', 'B', 'A']] permutations([1, 2]) → [[1, 2], [2, 1]] permutations(['ONE']) → [['ONE']] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 257 Post-solution available
Copyright Nick Parlante 2017 - privacy