【发布时间】:2020-05-18 04:34:56
【问题描述】:
如果我有一个清单:
x = [(1,3.),(2,4.),(5,6), (6,6.)]
我如何能够删除具有 6 的那些,因为它是第二个(或第一个,如果在索引方面)术语?它看起来像:
x = [(1,3.),(2,4.)]
我尝试过的代码总是给我错误:
TypeError: 'float' object is not subscriptable
或
TypeError: 'int' object is not subscriptable
【问题讨论】:
标签: python list int tuples typeerror