dictionary

asit lipun4u at gmail.com
Fri Oct 24 05:46:00 EDT 2008


what the wrong with the following code ????

>>> d={"server":"mpilgrim","database":"master",
... "uid":"sa",
... "pwd":"secret"}

>>> d
{'pwd': 'secret', 'database': 'master', 'uid': 'sa', 'server':
'mpilgrim'}

>>> ["%s="%s" % (k,v) for k,v in d.items()]
  File "<stdin>", line 1
    ["%s="%s" % (k,v) for k,v in d.items()]
                                          ^
SyntaxError: EOL while scanning single-quoted string



More information about the Python-list mailing list