你可以使用 in True 如果该元素出现在列表中,则 False
in
True
False
if Searchname in Names: found=True print('Found') else: print('Not found')