qberik

Untitled

Oct 30th, 2022
1,116
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. import itertools
  2.  
  3. group = input('Input elements: ').split()
  4.  
  5. permutations = list(itertools.permutations(group))
  6.  
  7. string_permutations = [ ' '.join(p) for p in permutations ]
  8.  
  9. print( *string_permutations, sep='\n' )
Advertisement
Comments
Add Comment
Please, Sign In to add comment