Posted By

magicrebirth on 05/17/10



Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Creating Dictionaries

 / Published in: Python

Any keyword arguments you pass to the dict constructor are added to the newly created dictionary before returning. Of course, you are limited to the keys that can be made into keyword arguments: valid Python variable names.

  1. dict(a=1, b=2, c=3)
  2. returns {'a': 1, 'b': 2, 'c': 3}

Report this snippet  

You need to login to post a comment.