Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # IRG 2022 Function By BOUSSAID MUSTAFA
- # APC SALI ADRAR 2022
- from math import floor
- def irg_2022(typeirg, soumis):
- t00 = 20000
- t01 = 4600
- t02 = 10800
- t03 = 24000
- t04 = 52800
- p = floor(soumis / 10) * 10
- if soumis <= 30009:
- irg = 0
- else:
- if 30010 <= soumis <= 40000:
- irg = (p - t00) * 0.23
- elif 40000 < soumis <= 80000:
- irg = (p - 40000) * 0.27 + t01
- elif 80001 < soumis <= 160000:
- irg = (p - 80000) * 0.30 + t01 + t02
- elif 160001 < soumis <= 320000:
- irg = (p - 80000) * 0.33 + t01 + t02 + t03
- elif soumis > 320000:
- irg = (p - 320000) * 0.35 + t01 + t02 + t03 + t04
- else:
- irg = 0
- abat = irg * 0.4
- if abat < 1000:
- abat = 1000
- elif abat > 1500:
- abat = 1500
- irg -= abat
- match typeirg:
- case 1: # ---->Normal
- if soumis < 35000:
- irg = (irg * 137 / 51) - (27925 / 8)
- case 2: # ---->Handicape
- if soumis < 42500:
- irg = (irg * 93 / 61) - (81213 / 41)
- irg = round(irg, 1)
- return irg
- # Resulta
- x = irg_2022(1, 67203.45)
- print(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement