用Pyhon计算并输出购买商品的实付金额与平均价格等数据

用Pyhon计算并输出购买商品的实付金额与平均价格等数据

M.
M.
2023-10-25 / 0 评论 / 123 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2023年10月25日,已超过530天没有更新,若内容或图片失效,请留言反馈。

说明

  • number1 赋值为1, number1在这里是一号商品数量
  • price1 赋值为45.20, price1 在这里是一号商品价格
  • amount 赋值为 number1
  • amount 二次赋值为 amount+number2
  • total 赋值为 number1*price1+number2*price2
  • discount 赋值为40.00
  • payable 赋值为 total-discount
  • averagePrice 赋值为 total/amount
  • total 定义为商品总额, discount 定义为商品优惠, payable 定义为实付总额, averagePrice 定义为平均价格

任务2-1

0

评论 (0)

取消