Python use growing or shrinking

Terry Hancock hancock at anansispaceworks.com
Thu Jan 23 13:51:55 EST 2003


Erik Max Francis wrote:
> the only thing I
> think would be missing for a coup de grace would be normalizing the
> figures so they're easier to read and interpret)

>>> pls = {'C#': 424, 'C': 4100, 'java': 2400, 'python': 630, 'Cobol': 244,
...          'VB': 1500, 'C++': 2000, 'perl': 1700}
>>> kv = pls.items()
>>> kv.sort(lambda a,b: a[1]-b[1])
>>> for k,v in kv:
...     print "%s\t%5d\t%5.1f%%" % (k, v, (float(v)/sum)*100)
... 
C        4100    31.5%
java     2400    18.5%
C++      2000    15.4%
perl     1700    13.1%
VB       1500    11.5%
python    630     4.8%
C#        424     3.3%
Cobol     244     1.9%

Of course, whether "representation by number of sites mentioning it on the 
web" is of any use whatsoever is another question entirely.  But python is 
an awesome command line calculator -- it has certainly outcompeted "calc" 
for me. ;-D

-- 
Anansi Spaceworks
http://www.anansispaceworks.com




More information about the Python-list mailing list