如何使inpit影响函数的参数? python,在我试图制作靴子的时候对我不适
def market_list(user_request):
fixed_list_option_1 = customer_products_string.split(' ', )
if user_request == 1:
return fixed_list_option_1
elif user_request == 2:
return fixed_list_option_1.count
customer_products_string = "pizza,apple"
user_request = input("What is your request? (insert the number of the command) : ")
print(market_list(user_request))
def market_list(user_request):
fixed_list_option_1 = customer_products_string.split(' ', )
if user_request == 1:
return fixed_list_option_1
elif user_request == 2:
return fixed_list_option_1.count
customer_products_string = "pizza,apple"
user_request = input("What is your request? (insert the number of the command) : ")
print(market_list(user_request))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
输入似乎在这里字符串。这就是为什么您应该使用user_request ==“ 1”或“ 2”或int(输入(“ ...”))的原因。
Input seems string here. That's why you should use user_request == "1" or "2" or int(input("...")).