Day 3 of Problem Solving Series In Python

Day 3 of Problem Solving Series In Python | Geethu Talks

Day 3 of Problem Solving Series

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-else decision making
  • ⚖️ Comparison operators: >= <= == !=
  • 🛡️ Input validation (0 to 100)
  • 🔢 int(input())

🧠 Step 1: Logic Build Cheddam

Idi oka decision problem. Rule simple:

  1. Marks teesukovali
  2. Marks 35 or above ayithe → Pass
  3. Lekapothe → Fail
marks ≥ 35 ? Pass : 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


CodeMeaning
int(input(...))Marks ni whole number ga teesukovadam
0 <= marks <= 100Marks valid range lo unnaya ani check
marks >= 3535 kuda include ayye condition
print("Pass")Condition true ayithe Pass
elseCondition 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-else tho 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

check out our website for more resources

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

Leave a Comment