K
Kermit Mei
Hello all, look at the following sentence:
I can't understand the second sentence because of the "for ... in".
I consider that the syntactics of "for" should be:
for k,v in params.items():
......
But there's no a colon here, why it can work?
Thanks!
['pwd=secret', 'database=master', 'uid=sa', 'server=mpilgrim']>>>params = {"server":"mpilgrim", "database":"master", "uid":"sa", "pwd":"secret"}
>>> ["%s=%s" % (k, v) for k, v in params.items()]
I can't understand the second sentence because of the "for ... in".
I consider that the syntactics of "for" should be:
for k,v in params.items():
......
But there's no a colon here, why it can work?
Thanks!