我正在尝试将其合并为一行-
1 3
10 20 40
30 20 10
5 6
10 20 40
30 20 10
49 22
10 20 40
30 20 10
我尝试过:
for x in set(l_rooms):
if l_rooms.count(x) == 1:
print(x)
但这只会产生一个生成器对象,实际上并不打印
答案 0 :(得分:1)
print([x for x in set(l_rooms) if l_rooms.count(x)==1])