Joined
Last Seen
0 Reputation Points
Unknown Quality Score
No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
0 Endorsements
Ranked #27.9K
I need a little bit of help here with comparing data sets. file1 = open("filename1.txt", "r") file2 = open("filename2.txt", "r") fileone = file1.readlines() filetwo = file2.readlines() file1 = close() file2 = close() exfile = open("results.txt", "w") for line1 in fileone: s1, v1, p1 = line[:-1].split(":") for line2 in filetwo: s2, … |
|
So far, I think I'm doing it right however it doesn't seem to generate the results I wanted. def occurrence(e,List): for item in List: s = 0 if item == e: s += 1 return s Basically I want my function to count how many times e occurs in List. … |