参考
【报错:TypeError: unsupported operand type(s) for |: \'str\' and \'str\'】
在进行键入值比较的时候,想要用“或”运算符对比较结果进行或运算作为 if语句 的判断条件。
结果报错了,说“这个或运算符号 ‘’|‘’ 不能用在‘str‘ 类型之间”????WTF?
ctnue = raw_input(\'Do you want to check the next one? T/F :\') # 屏显为如下所示: 并且键入了字符“T” # Do you want to check the next one? T/F :>? T # # 好的接下来我要比对以下键入字符的值,并做或运算 ctnue==\'T\' | ctnue==\'f\' # 屏显为:报错 # TypeError: unsupported operand type(s) for |: \'str\' and \'str\' # WTF??? # 好吧改为: (ctnue==\'T\') | (ctnue==\'f\') # 屏显为: # True # 解决……还有没有其他办法?额再说