1. 程式人生 > >個人所得稅繳納小程式

個人所得稅繳納小程式

3.6 習題
gong_zi = int(input("應發工資:"))
for i in range(gong_zi):
if gong_zi <= 3500:
print ("應交個稅:", 0)
print ("實發工資:", gong_zi)
break
elif gong_zi == 3500 + 1500:
ge_shui=("%.2f"% (gong_zi * 0.03))
print ("應交個稅:", ge_shui)
print ("實發工資:", gong_zi - float(ge_shui))
break
elif gong_zi >3500+1500 or gong_zi <= 3500+4500:
ge_shui = ("%.2f" % (gong_zi * 0.10))
print ("應交個稅:", ge_shui)
print ("實發:", gong_zi - float(ge_shui))
break
elif gong_zi > 3500+4500 or gong_zi <= 3500+9000:
ge_shui = ("%.2f" % (gong_zi * 0.20))
print ("應交個稅:", ge_shui)
print ("實發工資:", gong_zi - float(ge_shui))
break
elif gong_zi > 3500+9000 or gong_zi <= 3500+35000:
ge_shui = ("%.2f" % (gong_zi * 0.25))
print ("應交個稅:", ge_shui)
print ("實發工資:", gong_zi - float(ge_shui))
break
elif gong_zi > 3500+35000 or gong_zi <= 3500+55000:
ge_shui = ("%.2f" % (gong_zi * 0.30))
print ("應交個稅:", ge_shui)
print ("實發工資:", gong_zi - float(ge_shui))
break
elif gong_zi > 3500+55000 or gong_zi <= 3500+80000:
ge_shui = ("%.2f" % (gong_zi * 0.35))
print ("應交個稅:", ge_shui)
print ("實發工資:", gong_zi - float(ge_shui))
break
elif gong_zi > 3500 + 80000:
ge_shui = ("%.2f" % (gong_zi * 0.45))
print ("應交個稅:",ge_shui)
print ("實發工資:",gong_zi - float(ge_shui))
break
 1 3.6 習題
 2 gong_zi = int(input("應發工資:"))
 3 for i in range(gong_zi):
 4     if gong_zi <= 3500:
 5         print ("應交個稅:", 0)
 6         print ("實發工資:", gong_zi)
 7         break
 8     elif gong_zi == 3500 + 1500:
 9         ge_shui=("%.2f"% (gong_zi * 0.03))
10         print ("應交個稅:", ge_shui)
11 print ("實發工資:", gong_zi - float(ge_shui)) 12 break 13 elif gong_zi >3500+1500 or gong_zi <= 3500+4500: 14 ge_shui = ("%.2f" % (gong_zi * 0.10)) 15 print ("應交個稅:", ge_shui) 16 print ("實發:", gong_zi - float(ge_shui)) 17 break 18 elif gong_zi > 3500
+4500 or gong_zi <= 3500+9000: 19 ge_shui = ("%.2f" % (gong_zi * 0.20)) 20 print ("應交個稅:", ge_shui) 21 print ("實發工資:", gong_zi - float(ge_shui)) 22 break 23 elif gong_zi > 3500+9000 or gong_zi <= 3500+35000: 24 ge_shui = ("%.2f" % (gong_zi * 0.25)) 25 print ("應交個稅:", ge_shui) 26 print ("實發工資:", gong_zi - float(ge_shui)) 27 break 28 elif gong_zi > 3500+35000 or gong_zi <= 3500+55000: 29 ge_shui = ("%.2f" % (gong_zi * 0.30)) 30 print ("應交個稅:", ge_shui) 31 print ("實發工資:", gong_zi - float(ge_shui)) 32 break 33 elif gong_zi > 3500+55000 or gong_zi <= 3500+80000: 34 ge_shui = ("%.2f" % (gong_zi * 0.35)) 35 print ("應交個稅:", ge_shui) 36 print ("實發工資:", gong_zi - float(ge_shui)) 37 break 38 elif gong_zi > 3500 + 80000: 39 ge_shui = ("%.2f" % (gong_zi * 0.45)) 40 print ("應交個稅:",ge_shui) 41 print ("實發工資:",gong_zi - float(ge_shui)) 42 break
View Code