Python Flask SQL: 如何判断值是否不在列表中
在 Python Flask SQL 中,HandleGuancexinxi.leixing.in_() 表示判断一个值是否在列表中。如果要判断一个值是否不在列表中,则可以使用逻辑运算符 not in。
例如,使用 not in 来判断一个值是否不在列表中:
value = 'A'
if value not in ['A', 'B', 'C']:
print('Value is not in the list')
输出结果为:
Value is not in the list
原文地址: https://www.cveoy.top/t/topic/qjAO 著作权归作者所有。请勿转载和采集!