python分段算利润、税收
2024-10-19 06:02:33
'''
题目:企业发放的奖金根据利润提成。
利润(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)
最新文章
- C++设计模式-State状态模式
- MySQL 使用SELECT ... FOR UPDATE 做事务写入前的确认(转)
- 转: 带你玩转Visual Studio——带你理解多字节编码与Unicode码
- Scala underscore的用途
- Java从入门到精通——数据库篇之OJDBC版本区别
- week 与 strong区别 精辟的解释
- 自定义TabHost,TabWidget样式
- React+Redux学习笔记:React+Redux简易开发步骤
- IMLite轻量级即时通信工具开发指南
- [Swift]LeetCode11. 盛最多水的容器 | Container With Most Water
- c++ __declspec
- CentOS 7 MariaDB-MMM
- JS对象、数据类型区别、函数
- 【emWin】例程十五:触摸校准实例——五点校准法
- JavaSE笔记
- 全局组建封装(挂载到vue实例的原型中,通过this访问)
- CentOS7.5搭建Flask环境python3.6+mysql+redis+virtualenv
- canvas-圆弧形可拖动进度条
- English trip -- VC(情景课)4 C My feet hurt 我脚痛
- Linux网络(一)