• 用python写一个北京市的个税计算器


    #应纳税的钱:税前收入-5000元(起征点)-专项扣除(五险一金等)
    #工资个税的计算公式为:
    #个人所得税=应纳税的钱×适用税率-速算扣除数
    '''
    1、全月应纳税所得额不超过3000元:
    税率:3%; 速算扣除数(元):0
    2、全月应纳税所得额超过3000元至12000元:
    税率:10%; 速算扣除数(元):210
    3、全月应纳税所得额超过12000元至25000元:
    税率:20%; 速算扣除数(元):1410
    4、全月应纳税所得额超过25000元至35000元:
    税率:25%; 速算扣除数(元):2660
    5、全月应纳税所得额超过35000元至55000元:
    税率:30%; 速算扣除数(元):4410
    6、全月应纳税所得额超过55000元至80000元:
    税率:35%; 速算扣除数(元):7160
    7、全月应纳税所得额超过80000元:
    税率:45%; 速算扣除数(元):15160
    '''
    #定义税前工资
    Tax_salary = int(input("请输入你的工资:"))
    if Tax_salary > 5000:
        #应纳税的工资
        Taxable_salary = Tax_salary - 5000 - Tax_salary * 0.22
    
        if Taxable_salary <= 3000:
            # 个人所得税
            Personal_income_taxes = Taxable_salary * 0.03 - 0
    
        elif Taxable_salary > 3000 and Taxable_salary <= 12000:
            Personal_income_taxes = Taxable_salary * 0.1 - 210
    
        elif Taxable_salary > 12000 and Taxable_salary <= 25000:
            Personal_income_taxes = Taxable_salary * 0.2 - 1410
    
        elif Taxable_salary > 25000 and Taxable_salary <= 35000:
            Personal_income_taxes = Taxable_salary * 0.25 - 2660
    
        elif Taxable_salary > 35000 and Taxable_salary <= 55000:
            Personal_income_taxes = Taxable_salary * 0.3 - 4410
    
        elif Taxable_salary > 55000 and Taxable_salary <= 80000:
            Personal_income_taxes = Taxable_salary * 0.35 - 7160
    
        elif Taxable_salary > 80000:
            Personal_income_taxes = Taxable_salary * 0.45 - 15160
        #五险一金
        Five_one_gold = Tax_salary * 0.22
        #实发工资
        Net_pay = Tax_salary - Personal_income_taxes - Five_one_gold
    
        print("本月实发工资(税后)为:{}".format(Net_pay))
    else:
        print("本月实发工资(税后)为:{}".format(Tax_salary))
    

    执行结果演示:
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

  • 相关阅读:
    ACM题目————食物链
    ACM题目————Find them, Catch them
    hdu 1255 覆盖的面积 (线段树处理面积覆盖问题(模板))
    poj 3373 Changing Digits (DFS + 记忆化剪枝+鸽巢原理思想)
    hdu 3303 Harmony Forever (线段树 + 抽屉原理)
    hdu 2665 Kth number(划分树模板)
    poj 1348 Computing (四个数的加减乘除四则运算)
    hdu 1021 Fibonacci Again(找规律)
    HDU 1560 DNA sequence (IDA* 迭代加深 搜索)
    hdu 1560 DNA sequence(搜索)
  • 原文地址:https://www.cnblogs.com/ilovepython/p/11068893.html
Copyright © 2020-2023  润新知