@sn6e 企业发奖金按利润算提成
前言
使用python用索引和循环嵌套解决问题
一、题目
二、计算步骤
1.代码
代码如下(示例):
profit = int(input('请输入你的利润值'))
rg = [1000000,600000,400000,200000,100000,0]
rt = [0.01,0.015,0.03,0.05,0.075,0.1]
result = 0
for i in range(6):
if profit > rg[i]:
result += (profit-rg[i])*rt[i]
profit=rg[i]
print(result)
2.结果
代码如下(示例):
请输入你的利润值200000
17500.0
总结
养成习惯学习和总结