Append a new value to dict

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Thu Oct 23 04:18:59 EDT 2008


Marc 'BlackJack' Rintsch:
> counter['B'] = counter.get('B', 0) + 1

If you benchmark it, you will find that using the get() method it's
quite slower.

Bye,
bearophile



More information about the Python-list mailing list