语句d = ('x': 1, 'y': 2, 'z': 3)在Python 3.6中显示错误。新版本的正确语法是什么?

时间:2022-06-14 06:58:34

It shows that Variable annotation cannot be combined with tuple unpacking.

它表明变量注释不能与元组解包结合。

Please tell me the correct syntax for Python 3.6

请告诉我Python 3.6的正确语法。

1 个解决方案

#1


0  

The correct syntax for an object is:

对象的正确语法是:

d = {'x': 1, 'y': 2, 'z': 3}

#1


0  

The correct syntax for an object is:

对象的正确语法是:

d = {'x': 1, 'y': 2, 'z': 3}