print "Please Type Something"
resp = raw_input()
if resp *contains* "cuttlefish"
print "Response One"
elif resp *contains* "nautilus"
print "Response Two"
else:
print "Response Three"
Run Code Online (Sandbox Code Playgroud)
我需要知道的是使用正确的语法而不是填充包含.因此,例如,如果用户输入"两个墨鱼",那么程序应该通过打印"Response One"来响应
我试过在一些教程中尝试查找这些信息,所以如果你知道一个很好的解决这个问题,我不介意在这个方向指针,或者:/
Python是一种非常简单的语言,只需要思考英语,你就可以把它弄清楚;)
if 'cuttlefish' in resp:
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3981 次 |
| 最近记录: |