简单的 :)
password = "thisJaKob"
firstname = "jakOB"
lastname = "Bowyer"
test_pass = password.lower()
if (firstname.lower() in test_pass) or (lastname.lower() in test_pass):
print "Idiot. don't use names in passwords."
因为字符串是不可变的,所以它们支持in
运算符,该运算符检查左侧是否是右侧的有效子字符串。