Append data to a list within a dict
Tina I
tinaweb at bestemselv.com
Sat Apr 14 02:13:28 EDT 2007
Paul Rubin wrote:
> Tina I <tinaweb at bestemselv.com> writes:
>> ListDict = {
>> 'one' : ['oneone' , 'onetwo' , 'onethree'],
>> 'two' : ['twoone' , 'twotwo', 'twothree'],
>> 'three' : ['threeone' , 'threetwo', threethree']}
>>
>> Now I want to append 'twofour' to the list of the 'two' key but I
>> can't figure out how to that?
>
> Is this a class exercise? Hint:
> 1) figure out how to access the list of the 'two' key
> 2) append 'twofour' to it.
He he... at the age of 40 I'm well beyond school work ;)
But thanks anyway
Tina
More information about the Python-list
mailing list