python编程怎么打开帮助_Python编程帮助?

我一直在尝试制作一个类似收银机的代码,用户可以在其中输入产品名称、价格和数量。我有四种产品。在做了所有这些添加,我需要得到5%的GST,然后打印出包括GST在内的总金额。这就是到目前为止我可以得到的,而且我对python还不太熟悉,这就是为什么我不知道很多错误和其他关键字的原因。我得到了和ut,但当我乘法时,它说它不能乘以字符串和整数。我试着改变变量名,做了其他所有的事情,但没有给出总数。在name1 =raw_input('What Item do you have: ')

price1 = float(input('What is the price of your item: '))

quantity1 = float(input('How many are you buying: '))

name2 = raw_input('What Item do you have: ')

price2 = float(input('What is the price of your item: '))

quantity2 = float(input('How many are you buying: '))

name3 = raw_input('What Item do you have: ')

price3 = float(input('What is the price of your item: '))

quantity3 = float(input('How many are you buying: '))

name4= raw_input('What Item do you have: ')

price4 = float(input('What is the price of your item: '))

quantity4 = float(input('How many are you buying: '))

sum_total= (price1 * quantity1), (price2 * quantity2), (price3 * quantity3), (price4 * quantity4),

print(' %.2f ' % quantity1+quantity2+quantity3,' X ', name1+name2+name3,' @ %.2f ' %

price1+ price2+price3,' = %.2f ' % total)

divv = sum_total / 100

percent = divv * 0.05

gst = sum_total + percent

print('The suggested gst is %.2f '% percent )

print('That will be a total of: %.2f '% gst)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值