Question: my code Need help on python mycode: file=open(search1.txt,r+) word1=open(word1.txt,r+) wordcount={} word2=word1.readlines() for word2 in file.read().split(): if word2 not in wordcount: wordcount[word2] = 0 else: wordcount[word2]
my
code
Need help on python
mycode:
file=open("search1.txt","r+") word1=open("word1.txt","r+") wordcount={} word2=word1.readlines() for word2 in file.read().split(): if word2 not in wordcount: wordcount[word2] = 0 else: wordcount[word2] += 1 print (word2) file.close();
word 1:
Tears go I you Love when
search1.txt :
What do I do, When I'm still in love with you? You walked away, 'Cause you didn't want to stay. You broke my heart, you tore me apart. Every day I wait for you, Telling myself our love was true. But when you don't show, more tears start to flow. That's when I know I have to let go.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
