[Tutor] assigning list to keys

Todd Matsumoto tmatsumoto at gmx.net
Tue Jul 14 08:58:18 CEST 2009


The other day I needed to pack a dictionary, the value of each key was a list. In the code I was packing the list and the dictionary at the same time. First I tried something like this:

list = []
dict = {}
x = 1

dict['int'] = list.append(x)

The result was {'int': None}. Why is the value None?


Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02

More information about the Tutor mailing list