dicts & lists together

Raymond Hettinger vze4rx4y at verizon.net
Thu Nov 4 02:36:54 EST 2004


"Brad Tilley" <bradtilley at gmail.com>
> I have a dict that associates strings to numbers like this {'abc': 1,
> 'xyz':2, '123':3,...} I am then given a list of strings ['abc', 'xyz',
> '123',...] and asked to associate a number to each string in the list
> according to the string's value in the dict. I am at a loss as to how to
> do this, can someone show me where to start?

Is this a homework assignment?


Raymond Hettinger





More information about the Python-list mailing list