Day 3 of Problem Solving Series In Python | Geethu Talks

Table of Contents
Day 3 of Problem Solving Series
👋 Hi friends! Geethu Talks ki welcome. 34 marks vasthe fail, 35 vasthe pass. Python ki idi ela telusthundi? Chuddam!
🎬 Reel chudaledha? Instagram / YouTube lo @GeethuTalks ni follow avvandi.
🧩 Real-life Problem
Mee college lo passing marks 35 out of 100. Marks enter chesthe automatically Pass leda Fail cheppe program kavali.
📋 Task: Marks teesukuni 35 or above ayithe Pass, lekapothe Fail print cheyyandi.
📥 Sample input: 35 | 34
📤 Sample output: Pass | Fail
📚 Concepts Covered
- 🔀
if-elsedecision making - ⚖️ Comparison operators:
>= <= == != - 🛡️ Input validation (0 to 100)
- 🔢
int(input())
🧠 Step 1: Logic Build Cheddam
Idi oka decision problem. Rule simple:
- Marks teesukovali
- Marks 35 or above ayithe → Pass
- Lekapothe → Fail
💡 Analogy: if-else security guard laga: requirement meet ayithe entry, lekapothe no entry.
💻 Step 2: Python Code
marks = int(input("Enter marks: "))
if 0 <= marks <= 100:
if marks >= 35:
print("Pass")
else:
print("Fail")
else:
print("Invalid marks")
✅ Output
Enter marks: 35
Pass
🔍 Line by line
| Code | Meaning |
|---|---|
int(input(...)) | Marks ni whole number ga teesukovadam |
0 <= marks <= 100 | Marks valid range lo unnaya ani check |
marks >= 35 | 35 kuda include ayye condition |
print("Pass") | Condition true ayithe Pass |
else | Condition false ayithe Fail |
⚠️ Common Mistake Alert
❌ Wrong: >= badulu > use chesthe, exactly 35 vachina student fail avuthadu
marks = 35
if marks > 35:
print("Pass")
else:
print("Fail")
Result:
Fail
✅ Right: >= use cheyyandi, so that 35 kuda Pass avuthundi.
💡 Bonus tip: = value assign chestundi, == value compare chestundi. Condition lo eppudu == / >= vadandi.
📝 Quick Recap
- ✔️
if-elsetho decisions teesukunnam - ✔️
>=vs>difference telusukunnam - ✔️ Invalid input kuda handle chesam
🏋️ Practice Problems
🟢 Easy: Oka number teesukuni Even leda Odd ani print cheyyandi (hint: %).
Input: 7 → Output: Odd
🟡 Medium: Age teesukuni 18 or above ayithe ‘Eligible to vote’, lekapothe ‘Not eligible’ print cheyyandi.
Input: 18 → Output: Eligible to vote
🔴 Challenge: Rendu subjects marks teesukondi. Rendu subjects lo kuda 35 or above ayithe matrame Pass (hint: and).
Input: 40 and 30 → Output: Fail
💬 Mee answers comments lo share cheyyandi!
🚀 Next: Day 4 – Food Delivery Discount
Follow @GeethuTalks and stay tuned! 💛
⬅️ Previous: Day 2 of Problem Solving Series In Python


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