K12教育赛事综合服务平台
聚乐之家官方网站
下载聚乐之家官方App
专注青少年竞赛题库网站
我们需要用Python实现一个简易的商品结账模拟程序,具体需求如下:
price = int(input("请输入商品单价:")) count = int(input("请输入购买数量:")) total = price * count if total > 100: total -= 10 print("{:.1f}".format(total))
price = input("请输入商品单价:") count = input("请输入购买数量:") total = price * count if total > 100: total -= 10 print("{:.1f}".format(total))
price = int(input("请输入商品单价:")) count = int(input("请输入购买数量:")) total = price * count if total >= 100: total -= 10 print("{:.1f}".format(total))
price = int(input("请输入商品单价:")) count = int(input("请输入购买数量:")) total = price * count if total > 100: total = total * 0.9 print("{:.1f}".format(total))