Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!usr/local/bin/python3.8
- # -*- coding: utf-8 -*import
- def permutations(chars, index):
- if index == len(chars):
- print(''.join(chars))
- return
- for i in range(index, len(chars)):
- chars[index], chars[i] = chars[i], chars[index]
- permutations(chars, index + 1)
- chars[index], chars[i] = chars[i], chars[index]
- permutations(list(input()), 0)
Advertisement
Add Comment
Please, Sign In to add comment