here2share

# permutations.py

Feb 28th, 2021
589
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # permutations.py
  2.  
  3. import itertools
  4.  
  5. for p in itertools.permutations([1, 2, 3, 4], 3):
  6.     print(''.join(['abcd'[i-1] for i in p]))
  7. '''
  8. abc
  9. abd
  10. acb
  11. acd
  12. adb
  13. adc
  14. bac
  15. bad
  16. bca
  17. bcd
  18. bda
  19. bdc
  20. cab
  21. cad
  22. cba
  23. cbd
  24. cda
  25. cdb
  26. dab
  27. dac
  28. dba
  29. dbc
  30. dca
  31. dcb
  32. '''
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×