assisging multiple values to a element in dictionary

Nick Vatamaniuc vatamane at gmail.com
Mon May 7 07:14:20 EDT 2007


On May 7, 7:03 am, saif.shak... at gmail.com wrote:
> Hi,
>        I have a dictionary which is something like this:
> id_lookup={
> 16:'subfunction',
> 26:'dataId',
> 34:'parameterId',
> 39:'subfunction',
> 44:'dataPackageId',
> 45:'parameterId',
> 54:'subfunction',
> 59:'dataId',
> 165:'subfunction',
> 169:'subfunction',
> 170:'dataPackageId',
> 174:'controlParameterId'}
>
>      How do i assign multiple values to the key here.Like i want the
> key 170 to take either the name 'dataPackageID' or the name
> 'LocalId'.I use this in my code,and hence if either comes it should
> work .
> Can someone help me.
>                   Thanks

id_lookup[170]=('dataPackageID', 'LocallId')

-Nick V.




More information about the Python-list mailing list