0
ユーザの入力(整数)を受け取り、それを使ってリストの3番目の引数を乗算します。私は私が現在持っているコードでこれについて移動する方法がわからない:Pythonはtxtファイルの各行に対して文を出力します
def add_cart():
cart_YorN = ""
while cart_YorN not in ("y", "n"):
cart_YorN = input("\nWould you like to add this item to your cart? ")
if cart_YorN == "y":
multiply = int(input("Okay, how many of this item would you like? \n")) #multiply is the variable that will carry the multiplication value
receipt_list.#????? #not sure what to do here
receipt.listは3つの引数を含むリストであると私は三番目が「乗算」を掛けたことにしたいです。 また、これを乗算すると、リストが更新されますか?
なぜこの仕事をして更新されますか? – ppperry
これはPythonなので... – nrhode