import Fraction def adjust_recipe(recipe: Recipe, servings: int) -> Recipe: # ࡐྉσʔλͷίϐʔΛ࡞Δ new_ingredients = list(recipe.get_ingredients()) recipe.clear_ingredients() for ingredient in new_ingredients: ingredient.adjust_proportion( Fraction(servings, recipe.servings) ) return Recipe(servings, new_ingredients) 17 / 46