Python Forum
Compare words Python - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Compare words Python (/thread-15603.html)



Compare words Python - xSphere - Jan-24-2019

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!


RE: Compare words Python - buran - Jan-24-2019

What have you tried? Post your code in python tags, full traceback for any error - in error tags, sample input and desired output.


RE: Compare words Python - xSphere - Jan-24-2019

(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


RE: Compare words Python - perfringo - Jan-24-2019

(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.