How do I sum all occurrences of  a number in a file?
I have a file with a bunch of numbers, each on it's own line:

5
3
11
3
7
3
5
5
11
7
7
...
How do i sum them up so that the output will be ,
5 :  15
3 :   9
11:  22
7 :   21


      
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to