>>> matrix
>>> matrix = [{1,2,3},{4,5,6},{7,8,9},{10,11,12}]>>> matrix
[{1, 2, 3}, {4, 5, 6}, {8, 9, 7}, {10, 11, 12}]
这是为什么??? 集合是无序的 逃兵 发表于 2021-8-17 14:59
集合是无序的
>>> matrix = [{1,2,3},{4,5,6},{8,9,7}]
>>> matrix
[{1, 2, 3}, {4, 5, 6}, {8, 9, 7}]
>>> matrix =
>>> matrix
>>> matrix =
>>> matrix
>>> matrix = [{1,2,3},{7,8,9},{4,5,6}]
>>> matrix
[{1, 2, 3}, {8, 9, 7}, {4, 5, 6}]
>>> matrix = [{1,2,3},{9,8,7},{4,5,6}]
>>> matrix
[{1, 2, 3}, {8, 9, 7}, {4, 5, 6}]
>>>那为什么只针对7,8,9??{:5_96:}好奇怪呀 Zjxat 发表于 2021-8-18 14:50
>>> matrix = [{1,2,3},{4,5,6},{8,9,7}]
>>> matrix
[{1, 2, 3}, {4, 5, 6}, {8, 9, 7}]
显示顺序取决于不同版本的python,不同的操作系统,甚至不同的运行时刻
这个顺序没有实际意义
你在使用set的时候认为是无序就行了 里面应该使用[ ]的话应该就有序了
页:
[1]