Simple Dictionary Problem

Robert Kern kern at taliesen.caltech.edu
Sun Aug 24 23:46:13 EDT 2003


In article <abc3fdd3.0308241906.7e3b800c at posting.google.com>,
	google at hanger.snowbird.net (Kris Caselden) writes:
> I'm still new to some of Python's finer details, so this problem is
> probably an easy fix. I can't seem to loop through a dictionary whose
> values are tuples.
> 
> For instance:
> 
> oldlist = {'name':(1,2,3)}
> newlist = []
> for x1,x2 in oldlist:
      ^^^^^
Here's your problem. Iterating over a dictionary yields only keys, not
key,value pairs.

-- 
Robert Kern
kern at caltech.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter




More information about the Python-list mailing list