Pradumya Gupta’s Post

🚀 Day 47 of #100DaysOfCode — Extracting Odd Numbers from an Array Hey everyone! 👋 Today’s challenge was about filtering elements in an array and returning a new array that contains only odd numbers. 👨💻 What I practiced today: ✅ Iterating through arrays efficiently ✅ Using conditional logic (% operator) ✅ Building a new array based on conditions ✅ Writing clean and readable Python functions 📌 Today's Task: ✔ Create a function getOdds(arr) ✔ Extract only odd numbers from the array ✔ Return a new array with the result 🧠 Example: Input: [1, 2, 3, 4, 5] Output: [1, 3, 5] Input: [2, 4, 6] Output: [] 💡 Key Takeaway: Filtering data is a core programming skill. Simple conditions combined with loops can help extract exactly what you need from a dataset. #100DaysOfCode #Python #Arrays #Programming #ProblemSolving #LearningToCode #CodingJourney #Day47

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories