I have two lines of the same length and you want to combine words that have the same index. I am also trying to match successive matches in which I am having problems.
For example, I have two lines
alligned1 = 'I am going to go to some show' alligned2 = 'I am not going to go the show'
I am looking to get the result:
['I am','show']
My current code is as follows:
keys = [] for x in alligned1.split(): for i in alligned2.split(): if x == i: keys.append(x)
What gives me:
['I','am','show']
Any guidance or help would be appreciated.
python string matching
GNMO11
source share