基于python的税额计算器

'''
    1.税额计算器
        1.输入工资,如果工资为0,结束循环
        2.根据工资计算缴纳的五险一金(工资缴纳上限:7662),计算公式如下:
            2.1 如果工资大于或者等于7662 五险一金=7662*五险一金的比例(0.225
            2.2 如果工资小于7662  五险一金 = 工资*五险一金比例
        3.计算应纳税所得额应纳税所得额 = 工资 - 五险一金 - 起征点(3500
        4.根据应纳税所得额所在的阶梯,计算税额,税额 = 应纳税所得额*阶梯税率-速算扣除数
        5.将缴纳的五险一金金额、税额、集到手工资输出 到手工资 = 工资 - 五险一金 - 税额
'''

while True:
    money = input('请输入您的工资:')
    money = float(money)
    if money <= 0:
        print('您不用交五险一金,不用交税')
        con = input('0退出游戏,任意键继续游戏:')
        if con == '0' :
            break
        else:
            continue
    elif money >= 7662:
        pay = 7662 * 0.225
    else:
        pay = money * 0.225

    pay_a = money - pay - 3500

    if 0 < pay_a < 1500:
        tax = pay_a * 0.03 -0
        last = money - pay - tax
        print('五险一金金额:', pay,'税额:', tax,'到手工资:', last)
    elif 1500 <= pay_a <4500:
        tax = pay_a * 0.1 - 105
        last = money - pay - tax
        print('五险一金金额:', pay, '税额:', tax, '到手工资:', last)
    elif 4500 <= pay_a <9000:
        tax = pay_a * 0.2 - 555
        last = money - pay - tax
        print('五险一金金额:', pay, '税额:', tax, '到手工资:', last)
    elif 9000 <= pay_a <35000:
        tax = pay_a * 0.25 - 1005
        last = money - pay - tax
        print('五险一金金额:', pay, '税额:', tax, '到手工资:', last)
    elif 35000 <= pay_a <55000:
        tax = pay_a * 0.3 - 2755
        last = money - pay - tax
        print('五险一金金额:', pay, '税额:', tax, '到手工资:', last)
    elif 55000 <= pay_a <80000:
        tax = pay_a * 0.35 - 5505
        last = money - pay - tax
        print('五险一金金额:', pay, '税额:', tax, '到手工资:', last)
    elif pay_a > 80000:
        tax = pay_a * 0.45 - 13505
        last = money - pay - tax
        print('五险一金金额:', pay, '税额:', tax, '到手工资:', last)
    else:
        last = money - pay
        print('五险一金金额:', pay, '您不用交税,请加油', '到手工资:', last)
    con = input('0退出游戏,任意键继续游戏:')
    if con == '0':
        break





你可能感兴趣的:(基于python的税额计算器)