def shut_down(s):
s = s.Lower()
if s == 'yes' :
return "Shutting down..."
elif s == 'no':
return "Shutdown aborted!"
else :
return "Sorry, I didn't understand you."
计算机告诉我你的shut_down函数引发了以下错误:'str'对象没有属性'Lower'
答案 0 :(得分:1)
您的.Lower()
在python中不可用,因为它使用区分大小写的语言.lower()
def shut_down(s):
s = s.lower()
if s == 'yes' :
return "Shutting down..."
elif s == 'no':
return "Shutdown aborted!"
else :
return "Sorry, I didn't understand you."