Pardon if this is silly, but I'm pretty new to coding. I have this code, that works, but I feel like it could be tighter than this, I just can't seem to get it to work any other way. The idea is to read a .txt file find incoming e-mail strings and organize the data by frequency of hour sent.Here is an example line that I'm looking for in the text:From email@emailaddress.com Sat Jan 5 09:14:16 2008Here is my code:fname = input(Enter file:)if len(fname) <1 : fname = filename.txtfh = open(fname)time = list()hours = list()hr = dict()for line in fh:        if not line.startswith(From ): continue        words = line.split()        time.append(words[5])for i in time:        i.split(:)        hours.append(i[:2])for h in hours:        hr[h]=hr.get(h, 0)+1l = list()for k,v in hr.items():        l.append((k,v))l.sort()for k, v in l:        print (k,v)
Counting e-mails in a mailbox for each hour
python;beginner;python 3.x;datetime;email