+ 1
Who can Help me?
I want a Programm in python which can give the number of commun wodrs from two Texts T1 and T2 (the two texts have the same number of words)
4 Respostas
+ 3
Aladin Tombari ,
here is a hint how it could be done:
- take the input for text1 from user and split() it. this will create a list like t1
- take the input for text2 from user and split() it. this will create a list like t2
- create a counter variable and set it to 0
- iterate with a loop trough t1, and use the given word from the loop variable to count the occurrence of
this word in t2. add the resulting value to the value in counter variable
- after the loop is done, print the number of common words that is hold in variable counter
+ 2
Aladin Tombari ,
if you like to get help from the community, please post your code here.
thanks!
+ 2
THANK YOU SO MUCH U HELPED ME A LOT
+ 2
Aladin Tombari ,
you are welcome!