Day 6 of Problem Solving Series In Python | Geethu Talks

Table of Contents
Day 6 of Problem Solving Series
👋 Hi friends! Geethu Talks ki welcome. Roju ₹50 save chesthe, konni rojullo entha avuthundo Python tho chuddam. Ee roju loops nerchukundam!
🎬 Reel chudaledha? Instagram / YouTube lo @GeethuTalks ni follow avvandi.
🧩 Real-life Problem
Kotha phone kosam roju ₹50 save cheyalani decide chesaru. N rojula tarvatha mee savings entha?
📋 Task: Days count teesukuni, prathi roju savings and final total print cheyyandi.
📥 Sample input: Days = 5
📤 Sample output: Total savings: ₹250
📚 Concepts Covered
- 🔁
forloop andrange() - 🧮 Accumulator pattern (
total = total + 50) - 🔢 Loop variable
- 🖨️ f-string tho progress print cheyadam
🧠 Step 1: Logic Build Cheddam
Same pani malli malli cheyyali, anduke loop:
total = 0tho start cheyyali- Prathi roju total lo ₹50 add cheyyali
- Days anni ayyaka total print cheyyali
💡 Analogy: Piggy bank laga: prathi roju coin veyyadam. Loop ante aa pani ni repeat cheyadam, total ante bank lo unna money.
💻 Step 2: Python Code
days = int(input("Number of days: "))
total = 0
for day in range(1, days + 1):
total = total + 50
print(f"Day {day}: ₹{total}")
print(f"Total savings: ₹{total}")
✅ Output
Number of days: 5
Day 1: ₹50
Day 2: ₹100
Day 3: ₹150
Day 4: ₹200
Day 5: ₹250
Total savings: ₹250
🔍 Line by line
| Code | Meaning |
|---|---|
total = 0 | Savings zero tho start (loop mundu) |
range(1, days + 1) | Day 1 nunchi last day varaku |
total = total + 50 | Prathi roju ₹50 add |
print(f"Day {day}...") | Prathi roju growing total chupinchadam |
print(f"Total...") | Loop aipoyaka final total |
⚠️ Common Mistake Alert
❌ Wrong: total = 0 ni loop lopala petti, prathi roju reset chesthe
for day in range(1, 4):
total = 0
total = total + 50
print(total)
Result:
50
✅ Right: total = 0 ni loop mundu okkasari rayandi.
💡 Bonus tip: range(days) 0 nunchi start avuthundi, last number include avvadu. Day 1 nunchi kavali ante range(1, days + 1).
📝 Quick Recap
- ✔️
forloop tho repeat chesam - ✔️ Accumulator: total lo add chesukuntu povadam
- ✔️
total = 0eppudu loop mundu
🏋️ Practice Problems
🟢 Easy: 1 nunchi N varaku numbers sum cheyyandi.
Input: 10 → Output: 55
🟡 Medium: 7 multiplication table 10 varaku print cheyyandi.
Output: 7 x 1 = 7 … 7 x 10 = 70
🔴 Challenge: Day 1 ₹50 save, tarvatha prathi roju ₹10 ekkuva (50, 60, 70…). 5 rojula total entha?
Expected output: ₹350
💬 Mee answers comments lo share cheyyandi!
🚀 Next: Day 7 – ATM PIN Attempts
Follow @GeethuTalks and stay tuned! 💛
⬅️ Previous: Day 5 of Problem Solving Series In Python


1 thought on “Day 6 of Problem Solving Series In Python”