最佳答案
if requested_toppings in available_toppings: # if ['m', 'f', 'e'] in ['m'', 'f', 'a', 'n']:
这结果永远是 False !
你应该打错代码了, 或许应该是
if requestsd_topping in available_toppings: # if 'm' in ['m'', 'f', 'a', 'n']:
效果应该是
第一行 “Adding m”
第二行”Sorry we don’t have f”
第三行 “Adding e”
效果应该是
第一行 “Adding m”
第二行 “Adding f”
第三行 “Sorry, we don’t have e”
讨论数量:
if requested_toppings in available_toppings: # if ['m', 'f', 'e'] in ['m'', 'f', 'a', 'n']:
这结果永远是 False !
你应该打错代码了, 或许应该是
if requestsd_topping in available_toppings: # if 'm' in ['m'', 'f', 'a', 'n']:
效果应该是
第一行 “Adding m”
第二行”Sorry we don’t have f”
第三行 “Adding e”
效果应该是
第一行 “Adding m”
第二行 “Adding f”
第三行 “Sorry, we don’t have e”
推荐文章: