dictionary

mblume mblume at socha.net
Fri Oct 24 21:21:53 CEST 2008


Am Fri, 24 Oct 2008 05:06:23 -0500 schrieb Tim Chase:

>>>>> ["%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
> 
> You have three quotation marks...  you want
> 
>    "%s=%s"
> 
> not
> 
>    "%s="%s"
> 
> -tkc
>
Or he may have wanted
 "%s = '%s'"
Another neat python feature.
HTH
Martin



More information about the Python-list mailing list