我的代码是
import requests
from pprint import pprint
from pip._vendor.distlib.compat import raw_input
recipe_ingredients = input("What is the recipe ingredients? ")
number_recipes = input("How many recipes do you want? ")
url = 'https://api.spoonacular.com/recipes/findByIngredients?ingredients={}&number={}&'.format(recipe_ingredients,number_recipes)
response = requests.get(url)
print(response)
但是,当我以(两种成分)奶酪和格式输入多个成分时,它返回第一个变量的结果,或者告诉我和存在语法错误。
有什么方法可以对搜索功能进行编程以接受and,从而可以显示两个单词的所有结果,因为用户很可能会将“ and”放在搜索中,而不是一种成分。
((我正在使用pycharm btw)