Beginner Codes/Python/Compound Interest Calculator
21%

Instructions

Syntax

amount = principal * (1 + rate/100) ** time

Compound Interest Calculator 📈

Vaddi mela Vaddi! (Interest on Interest)

Bank-la namba panam pota, adhuku vaddi tharuvanga. Compound Interest na enna? Mudhal varusham kedaikra vaddi-kum serthu adutha varusham vaddi kedaikum!

Indha project-la namba oru while loop use panni, ovvoru varushamum namba panam eppadi valarudhu nu paaka porom.

The Formula 🧮

Compound interest-ku oru direct mathematical formula irukku: A = P(1 + R/100)^t (A = Amount, P = Principal, R = Rate, t = Time)

Python-la idha epdi ezhudhalam na: amount = principal * (1 + rate/100) ** time.

Aana, loops eppadi work aagudhu nu practice panna, namba idha year-by-year oru while loop vechu calculate panna porom!

The Logic

  • principal: Namba mudhalla podra panam (e.g. 10000).
  • rate: Vaddi veedham (e.g. 5%).
  • years: Evlo varushathuku panam podrom (e.g. 3).

Oru while loop vachi ovvoru varushamum vaddi calculate panni, principal kooda add pannanum.

principal = 10000
rate = 5
years = 3
current_year = 1

while current_year <= years:
    # 1 varushathuku vaddi: (Panam * Rate) / 100
    interest = (principal * rate) / 100
    principal = principal + interest
    print(f"Year {current_year}: Rs.{principal:.2f}")
    
    current_year += 1 # Adutha varushathuku porom!

Ippo indha loop eppadi step-by-step interest calculate pannudhu nu interactive-a paakalam!

Compound Interest Loop Tracker

principal = 10000
rate = 5
years = 3
current_year = 1

while current_year <= years:
interest = (principal * rate) / 100
principal = principal + interest
current_year += 1
Initial investment: Rs. 10,000. Start the loop to see interest grow year by year!

Bank Balance

Rs. 10000.00
Yr 0
Yr 1
Yr 2
Yr 3

Your Turn! (Unga neram!)

Kizhe ulla editor-la code-a complete pannunga.

  1. interest calculate panni principal kooda add pannunga.
  2. current_year ah 1 increase panna marandhudathinga (illana infinite loop aagidum!)
  3. Kadaisiya loop mudinjadhum total amount-a print pannunga.

Help

Compound Interest CalculatorExercise 17/7730 XP
❴❵ script.py
python.code
python
Loading...
Terminal
Terminal — python
Beginner Codes Terminal v1.0.0
─────────────────────────────────────
Ready. Click "Run Code" to execute...
Ready
Piston APIPYTHON0 lines