PForE_10.2.py
name = input("Enter file:")
if len(name) < 1:
name = "mbox-short.txt"
handle = open(name)
lst = []
d = dict()
t =list(d.items())
for line in handle:
if line.startswith("From "):
wds = line.split()
time, else1, else2 = wds[5].split(':')
d[time] = d.get(time, 0) + 1
for time, count in d.items():
lst.append((time, count))
lst.sort()
for time, count in lst:
print(time, count)