🏠 Home 📚 Chapters 💻 Projects ℹ️ About
HomeProjects › Day 04
DAY 04 — 60 DAY PYTHON CHALLENGE

💻 Simple Interest Calculator

Python में Simple Interest Calculator — साधारण ब्याज

Advertisement

Complete Code

python — day04.py
def si_calculator():
    print("💰 Simple Interest Calculator")
    print("Formula: SI = (P × R × T) / 100")
    print("-" * 38)

    try:
        P = float(input("मूलधन — Principal (₹): "))
        R = float(input("ब्याज दर — Rate (%): "))
        T = float(input("समय — Time (years): "))

        SI    = (P * R * T) / 100
        total = P + SI

        print(f"\n{'='*38}")
        print(f"  मूलधन (P):        ₹{P:>10,.2f}")
        print(f"  ब्याज दर (R):     {R:>10}%")
        print(f"  समय (T):          {T:>10} years")
        print(f"{'─'*38}")
        print(f"  साधारण ब्याज:    ₹{SI:>10,.2f}")
        print(f"  कुल राशि:        ₹{total:>10,.2f}")
        print(f"{'='*38}")
    except ValueError:
        print("❌ सही number डालें!")

si_calculator()
OUTPUT
====================================== मूलधन (P): ₹10,000.00 ब्याज दर (R): 5% समय (T): 3 years ────────────────────────────────────── साधारण ब्याज: ₹ 1,500.00 कुल राशि: ₹11,500.00 ======================================

यह Code कैसे काम करता है?

SI = (P×R×T)/100 — यह basic finance formula है। f-string में :,.2f से comma और 2 decimal places format होते हैं। ₹ symbol directly use होता है।
Advertisement

📋 Project ka Introduction

Simple Interest Calculator Python ka Day 4 ka project hai. Is project mein aap Python ke important concepts practice karenge jo real-world applications mein bahut use hote hain.

Yeh project beginners ke liye design kiya gaya hai lekin kaafi concepts cover karta hai. Step by step samjho, code chalao, aur khud modify karke practice karo.

Is tarah ke projects banane se aapka Python confidence badh jaata hai aur aap asli problems solve karna seekh jaate hain. Chaliye code samjhte hain!

🧠 Is Project mein kya seekhoge?

Yeh project banate waqt aap ye Python concepts use karoge:
ConceptKya karta hai
VariablesData store karna
FunctionsReusable code blocks
LoopsRepeat karna
ConditionsDecisions lena
Input/OutputUser se interact karna

📝 Code kaise kaam karta hai — Step by Step

Neeche code ki poori logic step-by-step samjhayi gayi hai:
  1. Problem samjho: Simple Interest Calculator mein kya karna hai
  2. Required variables aur data structures decide karo
  3. Logic step-by-step likhó
  4. Code mein implement karo
  5. Test karo aur bugs fix karo

⚠️ Common Mistakes — Bhool mat jaana!

Beginners yeh galtiyan aksar karte hain — dhyan rakho:
  • ⚠️ Indentation sahi rakho — Python mein spaces matter karti hain
  • ⚠️ Variables ko use se pehle define karo
  • ⚠️ Input ko int()/float() mein convert karo agar number chahiye
  • ⚠️ Edge cases handle karo — kya hoga agar user galat input de?

🏋️ Practice Exercises — Aage badho!

Yeh project complete karne ke baad in exercises se practice karo:
  • 💡 Simple Interest Calculator mein naya feature add karo
  • 💡 Code ko functions mein refactor karo
  • 💡 Error handling improve karo
  • 💡 File mein data save karo

❓ Aksar Pooche Jane Wale Sawal (FAQ)

Q: Simple Interest Calculator project kyon banana chahiye?

A: Har project ek naya concept sikhata hai. Practice se hi Python fluent aati hai.
Q: Code run nahi ho raha?

A: Indentation check karo, syntax errors dekho, variables define hain ya nahi check karo.
Q: Kaise improve karein?

A: Pehle basic version complete karo, phir ek ek feature add karte jao.