python在列表中匹配合适的对象
# 需求:判断流年是否是咱们班学员
students = ['流年', '向日葵', 'Zing', '丽']
name = '流年'
if name in students[:]: #[:]表示在列表students中匹配对象
print('true')
else:
print('false')
# 需求:判断流年是否是咱们班学员
students = ['流年', '向日葵', 'Zing', '丽']
name = '流年'
if name in students[:]: #[:]表示在列表students中匹配对象
print('true')
else:
print('false')