Python有一个有序的字典.订购套装怎么样?
python set
我想做类似的事情:
>>> x = [1,2,3,4,5,6,7,8,9,0] >>> x [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] >>> y = [1,3,5,7,9] >>> y [1, 3, 5, 7, 9] >>> y - x # (should return [2,4,6,8,0])
但python列表不支持这种做法最好的方法是什么?
python list
python ×2
list ×1
set ×1