0
我想获取用户输入(一个整数)并使用它将列表中的第三个参数相乘。我不知道如何去用这个代码目前我有: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