🚀 Day-35 of #100DaysOfCode 🐍 Python Sorting Logic Challenge Today I implemented Bubble Sort from scratch to sort a list of numbers entered by the user—without using any built-in sorting functions. 🔹 What is Bubble Sort? Bubble Sort is a simple comparison-based sorting algorithm where adjacent elements are repeatedly compared and swapped if they are in the wrong order. 🔹 Concepts Practiced: ✔ Nested loops ✔ List traversal and element swapping ✔ Comparison-based sorting logic ✔ Understanding algorithm flow 🔹 Approach: Take n values from the user and store them in a list Repeatedly compare adjacent elements Swap them when they are out of order Continue until the list becomes sorted Although Bubble Sort is not the most efficient, it is excellent for learning how sorting algorithms work internally and strengthening core logic 💡 #Python #BubbleSort #SortingAlgorithm #CorePython #100DaysOfCode #Day35 #LearnPython #CodingPractice #PythonDeveloper
Implementing Bubble Sort from Scratch in Python
More Relevant Posts
-
🚀 Day-39 of #100DaysOfCode 🐍 Python Sorting Algorithm Challenge Today I implemented Insertion Sort from scratch to sort a list of numbers entered by the user—without using any built-in sorting functions. 🔹 What is Insertion Sort? Insertion Sort builds the sorted list one element at a time, similar to how we sort playing cards in our hands. 🔹 Concepts Practiced: ✔ Nested loops ✔ Element shifting logic ✔ In-place sorting ✔ Understanding algorithm flow 🔹 Approach: Start from the second element Compare it with the elements before it Shift larger elements one position ahead Insert the element at its correct position 🔹 Key Insight: Insertion Sort performs efficiently on small or nearly sorted datasets and helps understand how sorting works internally. Working through such algorithms strengthens core logic, array manipulation, and problem-solving skills 💡 #Python #InsertionSort #SortingAlgorithms #CorePython #100DaysOfCode #Day39 #LearnPython #CodingPractice #PythonDeveloper
To view or add a comment, sign in
-
-
💡 Python Tip – List Comprehension (Write Cleaner Code) While practicing Python today, I explored List Comprehension, a powerful feature that makes code more readable and efficient. Instead of writing a traditional loop, we can generate lists in a single line. 🔹 Example Traditional way: numbers = [] for x in range(10): numbers.append(x*x) Using List Comprehension: numbers = [x*x for x in range(10)] ✅ Benefits Cleaner code Faster execution More Pythonic approach 📌 Small improvements like this can make Python code simpler and more efficient. #Python #PythonTips #Coding #DataEngineering #LearningInPublic
To view or add a comment, sign in
-
-
🚀 Day-38 of #100DaysOfCode 🐍 Python Sorting Algorithm Challenge Today I implemented Selection Sort from scratch to sort a list of numbers provided by the user—without using any built-in sorting methods. 🔹 What is Selection Sort? Selection Sort repeatedly selects the smallest element from the unsorted portion of the list and places it at the correct position. 🔹 Concepts Practiced: ✔ Nested loops ✔ Minimum element selection logic ✔ Index tracking ✔ In-place swapping 🔹 Approach: Iterate through the list Find the minimum element in the remaining unsorted part Swap it with the current index Repeat until the list is fully sorted 🔹 Key Insight: Selection Sort has a time complexity of O(n²), making it useful for understanding sorting fundamentals rather than large datasets. Working through such algorithms builds strong foundational knowledge of sorting and array manipulation 💡 #Python #SelectionSort #SortingAlgorithms #CorePython #100DaysOfCode #Day38 #LearnPython #CodingPractice #PythonDeveloper
To view or add a comment, sign in
-
-
🚀 Python Learning Journey – Revision Day Today, I revised Day 10 and Day 11 topics to strengthen my understanding. Here’s what I revised: ✅ Tuples (immutability, count(), index(), built-in functions) ✅ Dictionaries (key–value pairs, adding, updating, removing elements) ✅ Dictionary methods like keys(), values(), items(), get(), update(), pop() Revision helped me clearly understand the differences between tuples and dictionaries. Strengthening fundamentals step by step 💪 Consistency continues! #Python #LearningJourney #Revision #Tuples #Dictionaries #Coding #KeepLearning
To view or add a comment, sign in
-
It's abstraction that Python provides, that links back to the infamous ABC language that I discussed in one of my earlier posts. One concept that’s easy to use but powerful to understand is sequence unpacking: records = [ ("Alice", (25, "Engineer", "NY")), ("Bob", (30, "Designer", "SF")), ] for name, (age, role, _) in records: print(f"{name} is a {age}-year-old {role}") This shows how unpacking binds only what you care about: name, age and role are only variables that are used for binding and while the other '_' becomes a throwaway variable. #PythonLearning #BackendEngineering
To view or add a comment, sign in
-
Python Learning Progress | 29th Jan Today’s Python class was focused on Regular Expressions (Regex) — a really powerful module used for pattern matching and text manipulation. We practiced concepts like: ✅ compile() ✅ search() ✅ findall() ✅ split() ✅ sub() It was interesting to see how efficiently Python can handle text processing with Regex. Looking forward to practicing more and strengthening these skills step by step. 🚀 #Python #Regex #Learning #CodingJourney #Programming Pooja Chinthakayala
To view or add a comment, sign in
-
-
A bit about CONDITIONAL STATEMENTS. Python allows us to control program flow based on conditions that evaluate to True or False. They work with numbers, strings, booleans and even dictionaries because Python evaluates them into Boolean values behind the scenes. It simply executes this command: "If this is true, do this, if not, try something else. Otherwise do this" Conditional statements is one of the fundamentals of automation and machine learning. Without them, we can't build logic, models or intelligent systems. I had an interesting moment learning this basics along many others. The journey continues #RisewithTechCrush #Tech4Africans #LearningwithTechcrush
To view or add a comment, sign in
-
-
Python Sets — Why They’re More Useful Than You Think In simple words: A set in Python is a collection that: • Stores only unique values. • Doesn’t maintain order. • Allows fast membership checks. Why it matters: - Removing duplicates becomes easy. - 'in' operations are much faster than lists. - Set operations like union & intersection are powerful in real-world logic. If you're serious about writing cleaner Python code, sets are essential. Which set operation do you use most in real projects? #Python #LearnPython #DataStructures #BackendDevelopment #PythonDeveloper #Coding
To view or add a comment, sign in
-
-
Python Tool for Review-Driven Regression Testing of ML LLM Outputs Released 📌 Introducing Booktest, a revolutionary Python tool that transforms regression testing for ML and LLM systems by replacing rigid assertions with review-driven, human-in-the-loop evaluations. It captures outputs as markdown, enables diff-based reviews, and uses tolerance metrics to distinguish real regressions from noise-making it ideal for complex, subjective AI outputs in production. 🔗 Read more: https://lnkd.in/dKpXEjxR #Booktest #Python #Regressiontesting #Llmoutputs #Markdownartifacts
To view or add a comment, sign in
-
Spent some time today revisiting something I used to completely overlook in Python — how objects actually behave behind the scenes. Earlier I used to memorize outputs. Now I’m trying to understand why they happen. A few things finally clicked for me: Variables don’t hold values, they point to objects. Lists and dictionaries change in place, integers and strings don’t. += behaves differently depending on the type — with lists it usually modifies the same object, but with strings it creates a completely new object. Most “tricky” interview questions are really about mutation vs reassignment. Shallow copy and deep copy make sense once you think in terms of references instead of values. Many Python surprises aren’t magic — they come from not understanding how references and objects work internally. Still learning, still fixing gaps, but this kind of clarity feels very different from just finishing tutorials. If you’re preparing for Python interviews, try predicting outputs instead of running code immediately. That exercise alone teaches a lot. #Python #LearningInPublic #BackendDevelopment #InterviewPreparation #
To view or add a comment, sign in
Explore related topics
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