I have a error in the output please help me out : Write a program to read through the mbox-short.txt and figure out the distribution by hour of the day for each of the messages. You can pull the hour out from the 'From ' line by finding the time and then splitting the string a second time using a colon.
From stephen.marquard@uct.ac.za Sat Jan  5 09:14:16 2008
Once you have accumulated the counts for each hour, print out the counts, sorted by hour as shown below.
**Expected output:**

04 3
06 1
07 1
09 2
10 3
11 6
14 1
15 2
16 4
17 2
18 1
19 1

**Code:**

fname = raw_input('Enter file name: ')


fhand = open(fname)

c = dict()

for line in fhand:

  if not line.startswith('From ') : continue

  pieces = line.split()

  time = pieces[5]

  parts = time.split(':')

  hour = parts[0]
  c[hour] = c.get(hour,0) + 1

lst = list()
for key in c:
  value = c[key]
  lst.append( (value, key) )

lst.sort()

for value, key in lst:
  print key, value


**Output I got**
06 1 ← Mismatch
07 1
14 1
18 1
19 1
09 2
15 2
17 2
04 3
10 3
16 4
11 6