On 03/04/17 16:42, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > Sorry. That was stupid of me. The loop does nothing. >
On the contrary, the loop does an awful lot, just not what the OP was expecting. >>> with open(file_path) as a: >>> b = a.read() >>> for year in b: >>> if get_year in b: >>> count += 1 -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor