当我运行代码并输入“1”或“2”时,它会给出响应
Sorry, we didn't understand your selection.
我如何解决这个问题,使它给我正确的答案?你知道吗
我试过把“1”和“2”串起来。你知道吗
def cs_service_bot():
# Replace `pass` with your code
response = input("Hello! Welcome to the DNS Cable Company's Service Portal. Are you a new or existing customer? \n [1] New Customer \n [2] Existing Customer \n Please enter the number corresponding to your choice:")
if response == "1":
return new_customer()
elif response == "2":
return existing_customer()
else:
print("Sorry, we didn't understand your selection.")
return cs_service_bot()
cs_service_bot()
没有错误消息,它不会给出我正在寻找的答案,这些函数是:new_customer()
还是existing_customer()
尝试将中的
response
转换为字符串,然后进行比较。你知道吗如果您使用的是python2,输入返回整数, 所以你需要:
或:
示例:
编辑:
输出:
相关问题 更多 >
编程相关推荐