Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import itertools
- group = input('Input elements: ').split()
- permutations = list(itertools.permutations(group))
- string_permutations = [ ' '.join(p) for p in permutations ]
- print( *string_permutations, sep='\n' )
Advertisement