Income Tax Calculator (New Regime) Dry Run in PYTHON

Income Tax Calculator (New Regime) is an interactive PYTHON dry run visualizer from the If programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

Income Tax Calculator (New Regime) Program Code

# Income Tax Calculator - New Regime (FY 2023-24)
annual_income = float(input("Enter your annual income (in rupees): "))
is_senior = input("Are you a Senior Citizen (60+ years)? (y/n): ").lower() == 'y'

if is_senior:
    # Senior Citizen rates
    if annual_income <= 300000:
        tax = 0
    elif annual_income <= 500000:
        tax = (annual_income - 300000) * 0.05
    elif annual_income <= 1000000:
        tax = 10000 + (annual_income - 500000) * 0.20
    else:
        tax = 110000 + (annual_income - 1000000) * 0.30
else:
    # Regular individual rates
    if annual_income <= 300000:
        tax = 0
    elif annual_income <= 600000:
        tax = (annual_income - 300000) * 0.05
    elif annual_income <= 900000:
        tax = 15000 + (annual_income - 600000) * 0.10
    elif annual_income <= 1200000:
        tax = 45000 + (annual_income - 900000) * 0.15
    elif annual_income <= 1500000:
        tax = 90000 + (annual_income - 1200000) * 0.20
    else:
        tax = 150000 + (annual_income - 1500000) * 0.30

# Section 87A Rebate (income up to ₹7,00,000)
if (not is_senior and annual_income <= 700000) or (is_senior and annual_income <= 700000):
    if tax > 0:
        tax = 0
        print("\n Rebate under Section 87A applied - No tax payable")

# Calculate cess (4%)
cess = tax * 0.04
total_tax = tax + cess

print("\n" + "="*50)
print("       INCOME TAX CALCULATION (New Regime)")
print("="*50)
print(f"Annual Income        : ₹{annual_income:,.2f}")
print(f"Status               : {'Senior Citizen' if is_senior else 'Regular'}")
print(f"Income Tax           : ₹{tax:,.2f}")
print(f"Health & Education Cess: ₹{cess:,.2f} (4%)")
print("-"*50)
print(f"TOTAL TAX PAYABLE    : ₹{total_tax:,.2f}")
print("="*50)

if total_tax == 0:
    print(" No tax payable under New Regime!")
else:
    print(f"Effective Tax Rate   : {(total_tax/annual_income)*100:.2f}%")

View the complete If programs page.

Program Console Income Tax Calculator (New Regime) Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.