0
When I spin that code:
fname = input('File name: ')
fhand = open(fname)
count = 0
for line in fhand:
if line.find('Subject:'):
count = count + 1
print('There were', count, 'subjects lines in ', fname)
With input: mbox-short.txt (Link below)
Correct output: 27
Recent Output: 1883
I have no idea why.
txt file link
py version: 3.8.3 - I don’t even know why I’m using this version, if you have any opinion about it please comment
As for the version of Python: 3.8.3 is very current, and is indicated to use. A few days ago came out version 3.9.0 - when you want, and especially if you are going to start a new project, you can upgrade to the 3.9 series
– jsbueno