Project2: My Output not the same with the Solution Output

Screen Link:

My Output is different from the solution output provided. Please what is my mistake

Hi! @oriji.sandra
It would be great if you could share the full output. From the output which I can see here in image it seems that your output is correct but, I believe you are talking about the dictionary order which you got as a output, regarding that I would say "the keys used in the dictionary are in arbitrary order (if you want it sorted, just apply the sorted() function to it) so, its ok if your order and order given in solution is different as far as key-value pair is same.

I would also appreciate if you read these posts 1 2.

Hope it helps!

Apologizes for not showing my full output. I read the posts you recommended. Below is my full output:

Hi! @oriji.sandra
No worries, So as I explained in my previous reply you can also see that your key-value pair and solution key-value pair are the same, it’s just that their order is not the same, It happens because keys used in the dictionary are in arbitrary order.
you can see my output below, it’s just that the order of keys is different but the key-value pair is the same. That’s because keys in the dictionary have arbitrary order behaviour.

No. of comments ask post created each hour were received: 
 {'23': 543, '09': 251, '11': 641, '15': 4477, '13': 1253, '20': 1722, '17': 1146, '22': 479, '21': 1745, '10': 793, '00': 447, '02': 1381, '03': 421, '08': 492, '16': 1814, '12': 687, '18': 1439, '04': 337, '06': 397, '05': 464, '01': 683, '07': 267, '19': 1188, '14': 1416}

You can further read here and I found this helpful as well.

Hope it helps!
Happy Learning! :slight_smile:

1 Like

Thank You. I appreciate