Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/339.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python2.7中{“item1”,“item2”,“…}的含义是什么_Python_Dictionary_Structure - Fatal编程技术网

python2.7中{“item1”,“item2”,“…}的含义是什么

python2.7中{“item1”,“item2”,“…}的含义是什么,python,dictionary,structure,Python,Dictionary,Structure,我对python2.7中的结构{item1,item2,item3}感到困惑。是一套吗 我所做的: 当 那么,{item1,item2,…}在python2.7中的含义是什么呢 type(a) 是的。您可以使用类型 是的。您可以使用type。您可以使用type函数检查对象的类型,并了解发生了什么: 您将发现在python2.7中,a={1,2,3}是一个集合。您可能会想,嘿,但是在python2.3中也有一套数据结构 嗯,语法略有不同: 因此,在python2.7中,他们为创建集合添加了语法糖

我对python2.7中的结构{item1,item2,item3}感到困惑。是一套吗

我所做的:

那么,{item1,item2,…}在python2.7中的含义是什么呢

type(a)
是的。您可以使用类型


是的。您可以使用type。

您可以使用type函数检查对象的类型,并了解发生了什么:

您将发现在python2.7中,a={1,2,3}是一个集合。您可能会想,嘿,但是在python2.3中也有一套数据结构

嗯,语法略有不同:


因此,在python2.7中,他们为创建集合添加了语法糖。

您可以使用type函数检查对象的类型,并了解发生了什么:

您将发现在python2.7中,a={1,2,3}是一个集合。您可能会想,嘿,但是在python2.3中也有一套数据结构

嗯,语法略有不同:


因此,在python2.7中,他们为创建集合添加了语法糖。

出发,但你看到的是@TemporalWolf不,这是一个集合。出发,但你看到的是@TemporalWolf不,这是一个集合。