0
# !/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
import itertools
import enchant
d = enchant.Dict("en_GB")
jword = input(str("Enter Word Here:-"))
lword = list(jword)
n = len(jword)
mword = itertools.permutations([lword],n)
if d.check(mword):
    print (mword)
else:
    print("Invalid input")

So this is the program I made. What I meant it to do was take an input (jword) and the make a list out of it and then check all the possible permutations of that list where the length of the permutation is the length of the original word.

After that it should check whether any of the permuted words is an English word using pyenchant. If it is, print that word, and if it is not, print "Invalid input".

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135

1 Answers1

0

input for python3

raw_input for python2

Your final print statement also has one indent too many.

foxyblue
  • 2,859
  • 2
  • 21
  • 29