如果列表中的特定项目不是第一项,是否有一种方法可以将其作为目标

Is there a way to target a particular item in a list if it is not the first item

pist = ['P58', 'P60', 'P0']

def print_it:
   For i in pist:
        if i == 'P0':
            print('yes')

        elif i == 'P58':
            print('yup')

        else:
            print('No')

所以这是问题所在: 我希望函数打印 'yes' 只要 P0 在列表中(不管 P58 是否在其中)但它会一直打印 'yup' 因为 P58 是列表中的第一项。可以有别的办法吗? 注意:列表不能更改。

def print():
    if 'P0' in pist:
        return 'yes'
    elif 'P58' in pist:
        return 'yup'
    else:
        return 'No'