Python dict

From annawiki
Revision as of 2019-07-28T10:39:36 by Tobiasco (talk | contribs) (Created page with "<pre> >>> dict(a=1,b=2) {'a': 1, 'b': 2} >>> d=dict(a=1,b=2) >>> d {'a': 1, 'b': 2} >>> **d File "<stdin>", line 1 **d ^ SyntaxError: invalid syntax >>> dict(**d) {...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
>>> dict(a=1,b=2)
{'a': 1, 'b': 2}
>>> d=dict(a=1,b=2)
>>> d
{'a': 1, 'b': 2}
>>> **d
  File "<stdin>", line 1
    **d
     ^
SyntaxError: invalid syntax
>>> dict(**d)
{'a': 1, 'b': 2}
>>> dict(**d)==d
True
>>>