首页 > 编程语言 > 详细

python分段算利润、税收

时间:2018-10-15 12:59:25      阅读:162      评论:0      收藏:0      [点我收藏+]
‘‘‘
题目:企业发放的奖金根据利润提成。
利润(I)低于或等于10万元时,奖金可提10%;
利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可提成7.5%;
20万到40万之间时,高于20万元的部分,可提成5%;
40万到60万之间时高于40万元的部分,可提成3%;
60万到100万之间时,高于60万元的部分,可提成1.5%,
高于100万元时,超过100万元的部分按1%提成,
从键盘输入当月利润I,求应发放奖金总数?
‘‘‘

# in_profit = int(input(‘净利润:‘))
in_profit = 1200000
profit = [1000000, 600000, 400000, 200000, 100000, 0]
rate = [0.01, 0.015, 0.03, 0.05, 0.075, 0.1]
total = 0
for index in range(0, 6):
    if in_profit > profit[index]:
        total = total + (in_profit - profit[index]) * rate[index]
        if index is 0:
            print("大于100万的奖金(1%)     :" + str(total))
        elif index is 1:
            print("加上60-100万的奖金(1.5%):" + str(total))
        elif index is 2:
            print("加上40-60万的奖金(3%)   :" + str(total))
        elif index is 3:
            print("加上20-40万的奖金(5%)   :" + str(total))
        elif index is 4:
            print("加上10-20万的奖金(7.5%) :" + str(total))
        elif index is 5:
            print("加上0-10万的奖金(10%%)   :%s" % str(total))

        in_profit = profit[index]
print("总奖金:")
print(total)


  

 

技术分享图片

 

python分段算利润、税收

原文:https://www.cnblogs.com/andy9468/p/9790166.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!