由于新税法是累进抵扣,所以每月需要缴税的金额也是不一样的,写了个python程序算一下自己每年要交多少个税
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
def get_rate(m):
if m <= 36000:
return 0.03
if m <= 144000:
return 0.1
if m <= 300000:
return 0.2
if m <= 420000:
return 0.25
if m <= 660000:
return 0.3
if m <= 960000:
return 0.35
return 0.45
def get_susuan(m):
if m <= 36000:
return 0
if m <= 144000:
return 2520
if m <= 300000:
return 16920
if m <= 420000:
return 31920
if m <= 660000:
return 52920
if m <= 960000:
return 85920
return 181920
def shebao(m):
if m > 25401:
return 25401
return m
def cal(m, dikou, jishu = None):
if jishu is None:
jishu = shebao(m)
cc = []
for x in xrange(12):