So I want to be able to print out number of occurances: For example if I have following in my text file:
cheeesepizza
chickenpizza
pepornisub
pizzaaregood
I want to be able to print "There are 2 pizza." ...Here is what I have so far
f = open(file_name)
total = 0
for line in f:
if "pizza" in line:
total += 1
f.close()
print total