Pradumya Gupta’s Post

🚀 Day 50 of #100DaysOfCode — Filtering Even Numbers from an Array Hey everyone! 👋 Today’s challenge was about data filtering — extracting only the even numbers from an array and returning them in a new list. 👨💻 What I practiced today: ✅ Iterating through arrays with loops ✅ Using the modulo operator (%) to check divisibility ✅ Conditionally building a new array ✅ Understanding the difference between filtering and modifying 📌 Today's Task: ✔ Create a function get_evens(arr) ✔ Return a new array containing only even numbers ✔ Keep the original array unchanged 🧠 Example: Input: [1, 2, 3, 4, 5, 6] Output: [2, 4, 6] Input: [1, 3, 5] Output: [] 💡 Key Takeaway: Filtering is a fundamental data processing skill. Whether you're cleaning datasets, preparing inputs for algorithms, or simply extracting meaningful information, knowing how to filter efficiently is key to writing clear and performant code. #100DaysOfCode #Python #Arrays #Filtering #EvenNumbers #DataProcessing #CodingJourney #Day50

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories