检查类似可能输入的有效方法?

Efficient way of checking similar possible inputs?

如果没有重复 "or" 函数,检查可以用不同方式编写的输入的最有效方法是什么? (即要写的较短版本:

if answer == "Yes" or answer == "yes" or answer == YES

谢谢!

检查它是否是集合的成员:

if answer in {'Yes', 'yes', YES}:
    ...
valid = ["Yes", "yes", "y", "ok"]

if answer in valid:
    print "You said yes"
else:
    print "You did not say yes"