-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtax_calculation_system.py
More file actions
116 lines (103 loc) · 4.38 KB
/
tax_calculation_system.py
File metadata and controls
116 lines (103 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
def initial_display():
print('''
Sunway College Account Department
Maitidevi,Kathmandu
Welcome to
Salary Tax Calculation System (STCS)
-----------------------------------------------------------------------------------
''')
def staff_info():
staffname=[]
staffaddress=[]
staffpan=[]
stafffy=[]
staffincome=[]
taxamount=[]
flag=[]
staffno=int(input("Enter the number of staff you want to provide data: "))
for i in range(staffno):
staffname.append(input("Enter the name of the staff: "))
staffaddress.append(input("Enter the address of the staff: "))
staffpan.append(input("Enter the PAN.no of the staff: "))
stafffy.append(input("Enter the year for which you want to calculate the tax: "))
staffincome.append(int(input("Enter the income of the staff in one month: ")))
inpu=input("Enter 'Y' for Married and 'N' for Unmarried Status: ").upper()
flag.append(inpu)
tax=calculate_tax_of_staff(flag[i],staffincome[i])
taxamount.append(tax)
for i in range(staffno):
display(staffname[i],staffaddress[i],staffpan[i],staffincome[i],taxamount[i],stafffy[i],flag[i])
f=open("abc.txt","a")
f.write("Staff name: "+staffname[i]+", ")
f.write("Staff address: "+staffaddress[i]+", ")
f.write("Staff PAN: "+staffpan[i]+", ")
f.write("For Year: "+stafffy[i]+", ")
f.write("Staff income: "+str(staffincome[i])+", ")
f.write("Tax amount: "+str(taxamount[i])+"\n")
f.close()
print('----------------------------------------------------------------------------------------------------------')
def calculate_tax_of_staff(flag,salary):
income=salary*12
if(flag=='N'):
def calculate_tax_of_unmarried():
if(income<=400000):
tax_amount=income * 0.01
elif(income>400000 and income<=500000):
tax_amount=(400000*0.01)+ ((income-400000)*0.10)
elif(income>400000 and income<=700000):
tax_amount=(400000*0.01)+ ((100000)*0.10)+(income-500000)*0.20
elif(income>400000 and income<=1300000):
tax_amount=(400000*0.01)+ ((100000)*0.10)+((200000)*0.20) + (income-700000)*0.30
elif(income>=2000000):
tax_amount=(400000*0.01)+ (income-400000*0.36)
return tax_amount
tax=calculate_tax_of_unmarried()
elif(flag=="Y"):
def calculate_tax_of_married():
if(income<=450000):
tax_amount=income * 0.01
elif(income>450000 and income<=550000):
tax_amount=(450000*0.01)+ ((income-450000)*0.10)
elif(income>450000 and income<750000):
tax_amount=(450000*0.01)+ (100000*0.10)+(income-550000)*0.20
elif(income>450000 and income<1300000):
tax_amount=(450000*0.01)+ (100000*0.10)+(200000*0.20)+(income-7500000)*0.30
elif( income>2000000):
tax_amount=(400000*0.01)+ (income-400000*0.36)
return tax_amount
tax=calculate_tax_of_married()
return tax
def display(name,address,pan,salary,taxamount,foryear,flag):
initial_display()
print(f'''
Name of the staff: {name} Address: {address}
PAN no: {pan} For Year:{foryear}
Monthly salary: {salary}
''')
if(flag=='N'):
if(salary*12<=400000):
slab="1%"
elif(salary*12<=500000):
slab="10%"
elif(salary*12<=700000):
slab="20%"
elif(salary*12<=1300000):
slab="30%"
elif(salary*12>2000000):
slab="36%"
elif(flag=='Y'):
if(salary*12<=450000):
slab="1%"
elif(salary*12<=550000):
slab="10%"
elif(salary*12<=750000):
slab="20%"
elif(salary*12<=1300000):
slab="30%"
elif(salary*12>2000000):
slab="36%"
print(f'''
Staff {name} with PAN {pan} fall under {slab} Tax salb.
{name} with (PAN {pan}) has+ to pay tax to government is [Rs.]= {taxamount}
''')
staff_info()