Posted By

dorseye on 08/23/09


Tagged

python dictionary


Versions (?)

Print keys, values for dictionary


 / Published in: Python
 

  1. >>> myD
  2. {1: 'a', 2: 'b'}
  3. >>> for key, value in dict.items(myD):
  4. ... print key, value
  5. ...
  6. 1 a
  7. 2 b

Report this snippet  

You need to login to post a comment.