我有一个Python列表,我为中的项目实现了一个单击侦听器,如果我有该列表中某个项目的索引
例如,我可以得到文本('text':'0000'),其中index=3或文本('text':'100'),其中index=24, 如何使用该项的索引打印该索引所在行中的所有其他数据
data = [{'text': '400'}, {'text': 'Dairy'}, {'text': '0000'}, {'text': 'Milkshake'}, {'text': '500'}, {'text': 'Available'}, {'text': '0.0'}, {'text': '1'}, {'text': 'Kisumu'},
{'text': '500'}, {'text': 'Electronics'}, {'text': '1111'}, {'text': 'Flower'}, {'text': '700'}, {'text': 'Available'}, {'text': '50'}, {'text': '2'}, {'text': 'Kisumu'},
{'text': '500'}, {'text': 'Electronics'}, {'text': '8888'}, {'text': 'Eggs'}, {'text': '900'}, {'text': 'Unavailable'}, {'text': '100'}, {'text': '5'}, {'text': 'Kisumu'}]
另一种方式
输出
相关问题 更多 >
编程相关推荐