creating a dictionary

mark rkmr.em at gmail.com
Mon Jan 29 21:45:40 EST 2007


i have few variables and i want to create a dictionary with these variables
such that the keys are the variable names and the corresponding values
are the variable values.how do i do this easily?
for ex:
var1='mark'
var2=['1','2','3']
my_dict = create_my_dictionary(var1, var2)

and my_dict is {'var1':'mark', 'var2':['1','2','3']}

is there a function for create_my_dictionary?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070129/5f0be9eb/attachment.html>


More information about the Python-list mailing list