Day 13 – Practice with Recursion, Loops, and String Logic in Python Day 13 was all about hands-on problem solving. I focused on strengthening my logical thinking by implementing common programming problems using functions, loops, recursion, and strings. What I practiced today: Recursion Concepts: Calculated the sum of N natural numbers using recursion Example: input = 5 → output = 15 Understood how recursive calls work and when to stop using base conditions Loop-Based Logic (Without Recursion): Printed N Fibonacci numbers using loops Learned why loops are more memory-efficient than recursion in some cases String Processing Problems: Found the frequency of each character in a string using dictionaries Counted occurrences of characters without using built-in methods Compared two strings and printed common characters Avoided duplicate counting using a checked/reference string Pattern & Combination Problems: Printed all possible character pairs from a given string Example: "abc" → ab, ac, bb, bc, ca, cb, cc Practiced nested loops to generate combinations List & String Manipulation: Reversed each string inside a list without using slicing Converted: ["apple", "banana", "orange", "mango", "grapes"] into reversed word format Key Takeaways: Improved understanding of nested loops and condition checks Learned how to avoid repeated computations Practiced writing logic without relying on shortcuts or built-in functions Strengthened confidence in solving interview-style problems Consistent practice like this is helping me think more clearly about how code actually works step by step. #Python #PythonPractice #ProblemSolving #Recursion #Loops #StringManipulation #LogicalThinking #DailyLearning #CodingPractice #ComputerScience

To view or add a comment, sign in

Explore content categories