请选出可以正确实现指定简易模拟功能的Python代码片段

qi538585 单选题 共 个子题

需求为:模拟简易购物总价计算,首先输入商品单价和购买数量,计算总金额;若总金额达到或超过100元,则减免10元后输出最终金额;否则直接输出总金额。

A
price = float(input("请输入商品单价:"))
count = int(input("请输入购买数量:"))
total = price * count
if total >= 100:
    total -= 10
print("最终总金额:", total)
B
price = float(input("请输入商品单价:"))
count = int(input("请输入购买数量:"))
total = price * count
if total > 100:
    total -= 10
print("最终总金额:", total)
C
price = float(input("请输入商品单价:"))
count = int(input("请输入购买数量:"))
total = price + count
if total >= 100:
    total -= 10
print("最终总金额:", total)
D
price = float(input("请输入商品单价:"))
count = int(input("请输入购买数量:"))
total = price * count
if total >= 100:
    total += 10
print("最终总金额:", total)
正在加载题目数据…
已答 /
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析
讨论
发布
登录后参与讨论 立即登录
发布讨论需先绑定并验证手机号 去绑定手机号
加载中…
我
我
回复 @
回复 @
发送
还没有人讨论,来发表第一条吧