如果有这样的字母/单词,我试图打印出 true,如果没有,则打印出 false,但无论我输入什么,它总是正确的。
phr1= raw_input("Enter a phrase or paragraph, and this will check if you have those letters/word in ur paragraph: ")
print "You entered: "+phr1
phr2= raw_input("Check if a word/letter exists in the paragraph: ")
phr2 in phr1
if True:
print "true"
elif False:
print "false"
input("Press enter")
当我运行代码时:
Enter a phrase or paragraph, and this will check if you have those letters/word in ur paragraph:
hello world
You entered: hello world
Check if a word/letter exists in the paragraph: g
true
Press enter
这怎么可能,g不存在,为什么它说它存在?