#请在这里编写代码 types = int(input("共购买多少种商品:")) total = 0 for i in range(types): goods = input("该商品名称:") price = float(input("该商品单价:")) number = int(input("该商品数量:")) print(f'商品名称:{goods},商品单价:{price},商品数量:{number}') total = total + price * number print(f'购买的商品总价为:{total}')