简体   繁体   English

有没有办法找出一个项目在列表中的位置,然后在另一个列表中找到相同位置的值

[英]Is there a way to figure out the position of one item in a list and then find the value in the same position in another list

Is there a more efficient way to do this?有没有更有效的方法来做到这一点?

在此处输入图片说明

Try that :试试看:

for i in range(5):
    if PlayerChoice == ClevelandCavs21[i]:
        FGStat = ClevelandCavs21FG[i]
        break

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 检查项目在一个列表到另一个列表中的位置 - checking the position of an item in one list to another list 如何比较列表中的项目与另一个列表中的项目具有相同的值和位置? Python 2.7 - How to compare if an item in a list has the same value AND position as an item in another list? Python 2.7 如何在一个列表上使用最小值的索引来查找字符串在另一列表上的位置 - How to use the index of a min value on one list to find the position of a string on another list 如何在python中找到列表项的位置? - How to find the position of an item of a list in python? 如何索引列表中的项目并从另一个列表中提取相同的索引 position - How is it possible to index an item in a list and pull up the same index position from another list 清单中的项目位置 - Item position in list 从python中的列表中删除一个位置到另一个位置元素 - Deleting one position to another position elements from list in python 如何从列表中删除一个值,并从另一个列表中删除同一 position 中的值 - How do I remove a value from a list, and remove a value in the same position from another list 使用2个字符串列表,试图找到一种方法来从相反的列表中以相同的位置/顺序打印字符串。(Python) - With 2 list of strings, trying to find a way to print the string in the same position/order from the opposite list.(Python) 在列表中找到最大值的总和和位置 - Find the sum and position of the maximum value in a list
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM