每当我运行它时,我都会得到第三个选项,因为它应该返回第一个选项,因为 s = 'yes'。这里出了什么问题?
def shut_down(s):
if s is 'yes':
return 'Shutting down...'
elif s is 'no':
return 'Shutdown aborted!'
else:
return "Sorry, I didn't understand you"
ans = 'Yes'
s = ans.lower()
shut_down(s)