【发布时间】:2022-01-25 06:24:30
【问题描述】:
tuple= [['nike airjordan kahverengi', 42, 6],['nike airjordan sarı', 42, 10], ['nike airjordan mavi', 42, 8],['nike airjordan yeşil', 42 , 9]['nike airjordan sarı', 42, 10]]
def getOrderList(self):
orderSplit = ''.join(self.orderText).splitlines()
productList = []
for idx, i in enumerate(orderSplit, start = 0):
if(idx > self.starting_point):
if i == '@':
break
else:
productList.append([i.rstrip(i[-3:]), int(i[-2:]),idx])
return productList
这是获取元组的函数
orderList = self.product.getOrderList()
从现在开始,我在这里寻找元组中相同的那些
【问题讨论】:
-
请显示您尝试过的代码,并解释如何将项目视为相同。您示例中的子列表在索引 2 处具有不同的值。
-
从@BilltheLizard 开始,请参阅how to ask,了解您应该如何格式化您的问题以及包含哪些信息来帮助我们为您提供答案:)
-
抱歉解释@BilltheLizard。我改了
标签: python arrays python-3.x list sorting