I need help to compare letters between two words, the first word letters should be used to compare the letters in the second word...
I have an idea that i could use the for loop but im not quite sure how. Please help!
soUPERMan
Recommended Answers
Jump to PostIf you want compare words...
>>> a = 'I love DaniWEb forum and I`m Python user' >>> b = 'I want to help on my friend who also is Python user with comparing two sentences' >>> first = a.split(' ') >>> second = b.split(' ') >>> same …
Jump to PostHint ...
word = "python" for letter in word: index = word.find(letter) print( "letter %s is at index %s" % (letter, index) )
All 8 Replies
Krstevski
7
Junior Poster
soUPERMan
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
soUPERMan
snippsat
661
Master Poster
soUPERMan
snippsat
661
Master Poster
soUPERMan
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.