I changed to using line = line.strip() instead of line = line [:-1] in
the original and it it worked.
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
I was just happy that it worked, but was still curious as to why it
didn't before. Thanks for the idea, I'll look into it and see if this
is the case.
Thanks,
Kevin
--
http://mail.python.org/mailman/listinfo/python-list
Thanks to everyone for all the help!
Here's the (at least for now) final script, although note I'm using
2.3.5, not 2.4, so I can't use some of the tips that were given.
#!/usr/bin/python
# Filename: unscram.py
def sort_string(word):
'''Returns word in lowercase sorted alphabetically'''
ror, specifically:
(Note: ccehimnostyz is for zymotechnics, which is in the large
dictionary)
*--beginning of example--*
Enter a scrambled word : ccehimnostyz
Traceback (most recent call last):
File "unscram.py", line 62, in ?
results = dictionary[sort_string(lookup)]
KeyError: &