I have a list with sublists in it.
(我有一个带有子列表的列表。)
I want to print all the sublists with length equal to 3.(我想打印长度等于3的所有子列表。)
I am doing the following in python:
(我在python中执行以下操作:)
for x in values[:]:
if len(x)==3:
print x
values
is the original list.
(values
是原始列表。)
x
? (上面的代码是否为x
每个值打印所有长度等于3的子列表?)
length==3
only once. (我只想显示一次其中length==3
的子列表。)
The problem is solved.
(问题已经解决了。)
The problem is with the Eclipse editor.(问题出在Eclipse编辑器上。)
I don't understand the reason, but it is displaying only half of my list when I run my loop.(我不明白原因,但是在运行循环时,它仅显示列表的一半。)
Are there any settings I have to change in Eclipse?
(我必须在Eclipse中更改任何设置吗?)
ask by user1188821 translate from so