Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Python: Create a new dictionary object

Python: Create a new dictionary object
{filelink=16003}

# build a dictionary from a liste and a tuple
dict1= dict([('font', 12), ('size', 12)])
print dict
# build a dictionary from an expression
dict2= dict([(x, x*2) for x in ('a', 'b', 'c')])
print     dict2
print dict(january=31, february=28, march=31)

Users who found this page were searching for:

  • make new dictionary python
  • python new dictionnary
  • python create new object
  • dictionary with objects python
  • day definition in calendar class python

No comments yet.

Leave a Comment