レシピの分量(グラム)は 2 人分です。scale_recipe(amounts, people) を書いて、people 人分の分量を返しましょう。それぞれ people をかけて 2 で割り、round で小数第 1 位までに丸めます。
scale_recipe([200, 50, 3], 4)→[400.0, 100.0, 6.0]scale_recipe([100, 15], 3)→[150.0, 22.5]def scale_recipe(amounts, people):
new_amounts = []
for grams in amounts:
# ここにコードを書く:新しい分量を計算して追加する
pass
return new_amounts
実行すると例で試せます。よさそうなら提出しましょう。