Python Forum

Full Version: Compare words Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys, I need to compare 2 words of a list.
If I have hello and jello it has to print correct, because is the same word or it only has one different word.
How can I do this? Thanks!
What have you tried? Post your code in python tags, full traceback for any error - in error tags, sample input and desired output.
(Jan-24-2019, 07:57 AM)buran Wrote: [ -> ]What have you tried? Post your code in python tags, full traceback for any error - in error tags, sample input and desired output.
The problem is that I don't know how to start. I know to compare if there are the same words, but I don't know how to compare if there is one different word
(Jan-24-2019, 08:00 AM)xSphere Wrote: [ -> ]I know to compare if there are the same words

Then you have almost everything you need. Apply your knowledge (how to compare words) to letters in words. You just treat letter as word with length of one letter.