Income Tax Calculator (Old Regime) Dry Run in PYTHON

Income Tax Calculator (Old 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 (Old Regime) Program Code

# Income Tax Calculator - Old Regime (FY 2023-24)
annual_income = float(input("Enter your annual income (in rupees): "))

if annual_income <= 250000:
    tax = 0
    slab = "No Tax (Up to ₹2,50,000)"
elif annual_income <= 500000:
    tax = (annual_income - 250000) * 0.05
    slab = "5% on amount above ₹2,50,000"
elif annual_income <= 1000000:
    tax = 12500 + (annual_income - 500000) * 0.20
    slab = "₹12,500 + 20% on amount above ₹5,00,000"
else:
    tax = 112500 + (annual_income - 1000000) * 0.30
    slab = "₹1,12,500 + 30% on amount above ₹10,00,000"

# Section 87A Rebate (for income up to ₹5,00,000)
if annual_income <= 500000 and 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 (Old Regime)")
print("="*50)
print(f"Annual Income        : ₹{annual_income:,.2f}")
print(f"Tax Slab             : {slab}")
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. Great savings!")
else:
    print(f"Effective Tax Rate   : {(total_tax/annual_income)*100:.2f}%")

View the complete If programs page.

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