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

Python: Create a new dictionary object

Python: Create a new dictionary object

# 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:

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

No comments yet.

Leave a Comment