Skip to content

Instantly share code, notes, and snippets.

@niphadkarneha
Last active July 15, 2019 15:08
Show Gist options
  • Save niphadkarneha/bb961ef5fabf3878a1a89f2f8b9c70f6 to your computer and use it in GitHub Desktop.
Save niphadkarneha/bb961ef5fabf3878a1a89f2f8b9c70f6 to your computer and use it in GitHub Desktop.
# Python program to printout possible combination of words or letters given by user.
import itertools
s = input("Input a word or any random string: ")
#Changing the number in the bracket will print list of words with that length.
#To use the length of the input, type in (s, len(s))
t=list(itertools.permutations(s, 3))
for i in range(0,len(t)):
print(''.join(t[i]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment