python编程 个人所得税计算器

# author : momo
money = float(input("请输入您的工资(单位为k):"))
sum = 0
money1 = money-3.5
while True:
    if money>3.5:
        if money1-80>0:
            sum += (money1-80)*0.45
            money1 = 80
        if money1-55>0:
            sum +=(money1-55)*0.35
            money1 =55
        if money1-35>0:
            sum +=(money1-35)*0.3
            money1 =35
        if money1-9>0:
            sum +=(money1-9)*0.25
            money1 =9
        if money1-4.5>0:
            sum +=(money1-4.5)*0.2
            money1 = 4.5
        if money1-1.5>0:
            sum +=(money1-1.5)*0.1
            money1 = 1.5
        if 0<money1<=1.5 :
            sum +=money1*0.03
            break
    else:
        break
print("个人所得税为:%.5f千元" %sum)
s = money-sum
print("实发工资:%.5f千元"%s)

©️2020 CSDN 皮肤主题: 深蓝海洋 设计师:CSDN官方博客 返回首页