-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice_day2.py
More file actions
executable file
·29 lines (21 loc) · 1.24 KB
/
Copy pathpractice_day2.py
File metadata and controls
executable file
·29 lines (21 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/anaconda3/bin/python
# coding=UTF-8
#================================================================
# Copyright (C) 2018 HALO Ltd. All rights reserved.
#
# 文件名称:practice_day2.py
# 创 建 者:Zhangdunfeng
# 创建日期:2018-11-20 23:43:17
# 描 述:企业发放的奖金根据利润提成。利润(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,求应发放奖金总数?
#
#================================================================
i = int(input('净利润:'))
incomes = [1000000, 600000, 400000, 200000, 100000, 0]
rates = [0.01, 0.015, 0.03, 0.05, 0.075, 0.1]
total=0;
for index in range(len(incomes)):
if i > incomes[index]:
total+=(i - incomes[index])*rates[index]
print ((i - incomes[index])*rates[index])
i = incomes[index]
print (total)