python 判断是否再 列表里 in 不在列表里 not in
cars = ['audi', 'bmw', 'subaru', 'toyota'] print('audi' in cars)#True print('honda' in cars)#Flase # 是否不在列表里 not in print('honda' not in cars) #True
cars = ['audi', 'bmw', 'subaru', 'toyota'] print('audi' in cars)#True print('honda' in cars)#Flase # 是否不在列表里 not in print('honda' not in cars) #True