- 创建 .idea 目录和相关配置文件,设置项目结构 - 添加多个课堂成果示例代码,涵盖不同主题和功能 - 创建和配置 .gitignore 文件,忽略特定文件和目录
10 lines
409 B
Python
10 lines
409 B
Python
#请在这里编写代码
|
|
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}') |