🚀 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
Pradumya Gupta’s Post
More Relevant Posts
-
🚀 Master Logic Building in Python – 6 Phases, Multiple Levels I’m excited to start a new series where we’ll break down the art of logic building in Python into 6 structured phases are follows: 👉Phase 1 – Conditional Thinking (If–Else, Boolean Logic) 👉Phase 2 – Looping & Patterns (Iteration & Flow) 👉Phase 3 – Recursion (Thinking in self- reference) 👉Phase 4 – Basic Arrays(Iterative Logical Thinking) 👉Phase 5 – Strings (Basic Logic Building ) 👉Phase 6 – Mixed Logical Challenges (Applied Reasoning) Whether you’re a beginner or looking to refine your problem-solving mindset, this series will guide you through practical approaches to think, design, and code smarter. ⭕Starting with Phase 1: Level 1🔥 🐱Github : https://lnkd.in/gkKSJKDb #Python #LogicBuilding #CodingMindset #LearningSeries #Learning #Everyday #Coding #Programming
To view or add a comment, sign in
-
One underrated feature of NumPy: vectorization 🚀 One of NumPy’s most powerful features is vectorization—the ability to perform operations on entire arrays without writing explicit loops. This leads to cleaner code and significant performance gains. Example: Suppose you want to compute compound growth for 5 years at 8% . here is the python code---- import numpy as np years = np.arange(1, 6) growth = (1.08) ** years print(growth) [1.08 1.1664 1.259712 1.36048896 1.46932808] With a single expression, NumPy applies the operation across all elements efficiently—no for loop needed. Under the hood, this leverages optimized C code, making NumPy both expressive and fast. If you work with data, simulations, or numerical modeling, mastering vectorization is a game changer. #NumPy #Python #DataScience #ScientificComputing #Programming
To view or add a comment, sign in
-
Day 55 of #Python108DaysChallenge 🐍 Learned the Floyd–Warshall Algorithm for computing all-pairs shortest paths using dynamic programming. Key insights: ✔ Works on dense weighted graphs ✔ Handles negative weights (no negative cycles) ✔ Complexity O(V³) ✔ Useful for routing tables and path analysis Another powerful addition to the graph algorithms toolkit! #Python #DSA #Graphs #FloydWarshall #DynamicProgramming #LearningInPublic #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 19: Python Range Deep Dive Today is all about the power of the range() function! It’s not just for loops; it’s a memory-efficient sequence generator. Key takeaways: ✅ Custom Steps: Use range(start, stop, step) to skip numbers ✅ Smart Membership: Use in to instantly check if a number fits the sequence logic ✅ Efficient Length: len() tells you the count without expanding the list x = range(3, 10, 2) print(list(x)) # Output: [3, 5, 7, 9] r = range(0, 10, 2) print(6 in r) # Output: True print(7 in r) # Output: False print(len(r)) # Output: 5 Small steps every day lead to big results in 2026! 💻✨ Stay tuned for more!!! #Python #PythonJourney #Coding #LearnToCode #Programming #PythonCode #DataAnalyst #DataAnalytics #RangeFunction
To view or add a comment, sign in
-
Headline: Just launched: A High-Performance Smart Calculator built with Python & NumPy! Body: I’m excited to share my latest project—a Smart Calculator designed to handle more than just basic arithmetic. By leveraging the power of NumPy, this tool can process complex mathematical operations and array-based calculations efficiently. Key Features: Vectorized Operations: Performs lightning-fast calculations using NumPy’s optimized C-backend. Functional Design: Built using clean, modular Python functions for easy scalability. Error Handling: Robust logic to manage edge cases like division by zero or invalid inputs. This project was a great way to deepen my understanding of Python's scientific computing ecosystem and version control best practices. Check out the repository here: [Link to your GitHub Repo] I’d love to hear your feedback or suggestions for features to add in Version 2.0! #Python #NumPy #DataScience #SoftwareDevelopment #Coding #GitHub #OpenSource #MachineLearning #ProgrammingUNLOX®
To view or add a comment, sign in
-
🚀 Day-32 of #100DaysOfCode 🐍 Python Pattern Programming Challenge Today I worked on generating an Alphabet Triangle Pattern using ASCII values and nested loops. 🔹 Problem: Print a right-angled triangle where each row starts from A and prints characters sequentially. 🔹 Concepts Practiced: ✔ Nested for loops ✔ ASCII value manipulation using chr() ✔ Pattern visualization ✔ Loop resetting logic 🔹 Approach: Use ASCII value 65 to represent 'A' Convert ASCII to characters using chr() Reset the ASCII value at the start of each row Increase characters row-wise Pattern-based challenges help strengthen loop control, logical thinking, and character handling in Python 💡 #Python #PatternProgramming #CorePython #AlphabetPattern #100DaysOfCode #Day32 #LearnPython #CodingPractice #PythonDeveloper
To view or add a comment, sign in
-
-
Python Loops Made Simple! 🔄🐍 Why repeat yourself when you can automate? Python loops are the secret to writing efficient code in fewer lines. 1. FOR Loop (The Iterator) Use this when you want to go through a list or a fixed range. Example: for i in range(3): print("Python is fun!") (This will print the message 3 times) 2. WHILE Loop (The Condition Keeper) Use this when you want to keep running as long as a condition is True. Example: count = 1 while count <= 3: print("Loading...") count += 1 (Repeats until count reaches 3) Automation starts with mastering these two! 💻✨ Which one do you use most? Let me know in the comments! 👇 #Python #Coding #Programming #Automation #TechTips #LearnToCode #anshulyadav45
To view or add a comment, sign in
-
-
Today was all about going deeper into Python fundamentals 🐍💡 📌 What I covered today: 🔹 Scope (LEGB Rule) Understood how Python searches for variables and why scope matters for clean and predictable code. 🔹 Closures Learned how inner functions can remember variables from their enclosing scope even after the outer function has finished execution — powerful concept for state management and decorators. 🔹 OOPS – Class & Object Explored why classes are used over only functions: - Classes act as blueprints - Objects are real instances - Better structure, data protection, scalability, and real-world modeling - Also clarified how __init__ works and how each object maintains its own state. 👉 Revisiting fundamentals really changes how you think about writing better, cleaner code. Learning step by step, one concept at a time 🚀 #Python #LearningInPublic #PythonBasics #OOPS #Closures #Scope #Programming #DeveloperJourney
To view or add a comment, sign in
-
Data structures are the building blocks of any efficient Python application. Understanding the trade-offs between mutability, order, and uniqueness can significantly optimize your code’s performance. 📌 Quick Recap: Lists: Your go-to for ordered, changeable data. Tuples: Use these when you want to ensure data remains constant (immutable). Sets: Perfect for membership testing and removing duplicates. Dictionaries: The gold standard for key-value mapping and fast lookups. Save this cheat sheet for your next debugging session or technical interview! 🐍💻 #Python #Programming #DataScience #CodingTips #SoftwareDevelopment
To view or add a comment, sign in
-
-
🚀 Day 4 of Learning Python Today was about moving from basics to actual program flow and logic building 🧠 📌 What I focused on today: 🔹 Conditional statements (if, elif, else) 🔹 Loops (for, while) and iteration patterns 🔹 Using range() effectively 🔹 Writing small programs to combine logic + data 🔹 Understanding how control flow drives real applications Python is starting to feel less like syntax and more like problem-solving 💡 Consistency over speed — one solid day at a time 💪 #Day4 #PythonJourney #ProgrammingLogic #LearningInPublic #Consistency 🚀
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development