file = input("Enter file name:")
try:
fhand = open(file,'r')
except:
print("File not found")
quit() # Error: name 'quit' is not defined
count = 0
for line in fhand:
line =line.strip()
if line.startswith('Subject'):
count+=1
print('There were,',count,'subject lines in ',file)
This error should not occur. I am confused to heights what am I doing wrong here. i get the error 'name 'quit' is not defined'. Which should not come.
exit()?