Programming Examples

Python program to calculate income tax based on condition


Given below is a hypothetical table showing rate of income tax for an Indian citizen, who is below or up to 60 years.

Taxable Income (TI) in ₹ Income Tax in ₹
Up to ₹ 5,00,000 Nil
More than ₹5,00,000 and less than or equal to ₹7,50,000 (TI-5,00,000)* 10%
More than ₹7,50,000 and less than or equal to ₹10,00,000 (TI-7,50,000)* 20% + 30,000
More than 10,00,000 (TI-10,00,000) * 30% + 90,000

Write a Python code to input the name, age and taxable income of a person. If the age more than 60 years then display a message “Wrong Category”. IF the age is less than or equal to 60 years then compute and display the payable income tax along with the name of tax payer, as per the table given above.

Solution:

tax=0
name=input("Enter name :")
age=int(input("Enter age:"))
sal=int(input("Enter annual salary:"))
if(age>60):
    print("Wrong Category!")
else:
    if sal<=500000:
        tax=0
    elif sal<=750000:
        tax=(sal-500000)*10/100
    elif sal<=1000000:
        tax=30000+(sal-750000)*20/100
    elif sal>1000000:
        tax=90000+(sal-750000)*30/100
print("Name :",name)
print("Age :",age)
print("Tax Payable =₹",tax)
Output

Enter name :ravi

Enter age:45

Enter annual salary:650000

Name : ravi

Age : 45

Tax Payable =₹ 15000.0

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz