Python如何从列表中找出所有目标元素的索引

2025-04-07 05:30:07
推荐回答(1个)
回答1:

def myfind(x,y):
    return [ a for a in range(len(y)) if y[a] == x]