Day 13 of Problem Solving Series In Python

Day 13 of Problem Solving Series In Python | Geethu Talks

Day 13 of Problem Solving Series

Day 13 of Problem Solving Series

👋 Hi friends! Geethu Talks ki welcome. Mee peru lo entha vowels unnayo telusa? Ee roju Python tho message analyze cheddam.

🎬 Reel chudaledha? Instagram / YouTube lo @GeethuTalks ni follow avvandi.

🧩 Real-life Problem

WhatsApp message lo entha vowels (a, e, i, o, u) unnayo count cheyyali. Capital letters, small letters rendu count avvali.

📋 Task: Message teesukuni, uppercase/lowercase difference lekunda vowels count cheyyandi.
📥 Sample input: Geethu Talks
📤 Sample output: Vowels: 4

📚 Concepts Covered

  • 🔤 String ni loop cheyyadam
  • 🔡 lower() for case-insensitive check
  • 🔍 in operator
  • 🔢 Counter

🧠 Step 1: Logic Build Cheddam

String lo prathi character ni okkokkati check chestham:

  1. Message ni lowercase ga marchali
  2. Prathi character vowels ("aeiou") lo undha check
  3. Unte count + 1
  4. Final count print
g e e t h u   t a l k s  = 4

💡 Analogy: Prathi akshram ni okkokkati touch chesi ‘idi vowel na?’ ani adagadam laga.

💻 Step 2: Python Code

message = input("Enter message: ")
vowels = "aeiou"
count = 0

for ch in message.lower():
    if ch in vowels:
        count = count + 1

print(f"Vowels: {count}")

✅ Output
Enter message: Geethu Talks
Vowels: 4

🔍 Line by line


CodeMeaning
vowels = "aeiou"Vowels string
message.lower()Anni letters small cheyyadam
for ch in ...Prathi character okkokkati
ch in vowelsCharacter vowels lo undha?
count = count + 1Unte count penchu

⚠️ Common Mistake Alert

❌ Wrong: lower() marchipothe capital vowels count avvavu

message = "HELLO"
vowels = "aeiou"
count = 0
for ch in message:
    if ch in vowels:
        count = count + 1
print(count)   # should be 2

Result:
0

✅ Right: Loop ki mundu message.lower() vadandi.

💡 Bonus tip: Vowels string lo capital letters kuda rayochu: "aeiouAEIOU". Kani lower() simple.

📝 Quick Recap

  • ✔️ String ni character by character loop chesam
  • ✔️ in tho membership check
  • ✔️ lower() tho case problem solve

🏋️ Practice Problems

🟢 Easy: ‘banana’ lo ‘a’ entha sarlu vachindi?
Expected output: 3


🟡 Medium: String lo digits entha? (hint: ch.isdigit())
Input: abc123xyz45 → Output: 5


🔴 Challenge: String lo capital letters entha? (hint: ch.isupper())
Input: Geethu Talks Python → Output: 3


💬 Mee answers comments lo share cheyyandi!

🚀 Next: Day 14 – Movie Ticket Seat Layout

Follow @GeethuTalks and stay tuned! 💛

⬅️ Previous: Day 12 of Problem Solving Series In Python

check out our website for more resources

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

Leave a Comment