Did you know you can use #Python's `bisect` module to do a binary search? Here's a fun example using school grade latters and matching them with grade letters:
Binary Search with Python bisect module
More Relevant Posts
-
In this eighth video of the series Python for Tweens, we look at how to draw the Antigua and Barbuda flag. This posed a bit of a challenge due to the design of the flag. The task was to first draw the black section of the flag then the rising star on it. Once this was done, drawing the remaining sections of the flag was straight forward. Python for Tweens is a series intended to teach children ages 10 - 12 how to program using the Python Turtle Graphics module. https://lnkd.in/exbnftmd
Python for Tweens Part 8
https://www.youtube.com/
To view or add a comment, sign in
-
🚀 Day 2 — Python Journey Continuing with Python, today I focused on integer operations. 📌 What I learned: - Integer declaration - Addition, subtraction, multiplication - Division and modulus (remainder) - Power operation - Operator precedence (which operation runs first) 💡 What stood out: Understanding operator precedence is really important — the same expression can give different results if you don’t know the order of execution. Also, modulus (%) is more useful than it looks (especially for problems and logic building). Trying to stay consistent and build strong basics step by step. #Day2 #Python #CodingJourney #Consistency #LearnInPublic
To view or add a comment, sign in
-
-
💡 Tiny Python tip that improves code clarity With a normal tuple, you have to remember what each index stands for. That knowledge lives in your head, not in the code. `namedtuple` fixes this by giving semantic meaning to each position. You still get immutability and performance, but with clear, self-documenting access. #Python #PythonProgramming #CleanCode #CodingBestPractices #CodeReadability
To view or add a comment, sign in
-
-
Learning Python Functions Functions make code reusable and organized. I practiced: - Defining functions with def - Passing parameters and returning values - Creating small utility functions like greet_user() or calculate_sum() It’s amazing how functions keep code clean and efficient! #Python #Functions #PythonBasics #CodingJourney #LearningByDoing
To view or add a comment, sign in
-
ℙ𝕪𝕥𝕙𝕠𝕟 𝕊𝕥𝕣𝕚𝕟𝕘 𝕊𝕝𝕚𝕔𝕚𝕟𝕘 𝔻𝕣𝕪 ℝ𝕦𝕟 🐍 When working with Python, understanding how strings are manipulated is key. Many beginners get confused by how slicing ranges work—specifically the "start" and "stop" parameters. Can you perform a dry run of this code? #PythonProgramming #CodingChallenge #PythonDevelopers #LearnToCode #DataScience #SoftwareEngineering #PythonTips #CodingQuiz #TechCommunity #DryRun #ProgrammingLife #LinkedInLearning
To view or add a comment, sign in
-
-
Day 33/100 – #100DaysOfCode 🚀 Solved LeetCode #1480 – Running Sum of 1d Array (Python). Today I practiced prefix sum logic to compute the running sum of an array. Approach: 1) Initialize an empty list to store the running sum. 2) Maintain a variable sum = 0. 3) Traverse the array and keep adding each element to sum. 4) Append the updated sum to the result list. 5) Return the final running sum array. Time Complexity: O(n) Space Complexity: O(n) Understanding prefix sums helps solve many array problems efficiently 💪 #LeetCode #Python #DSA #Arrays #PrefixSum #ProblemSolving #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 4/100 – Python Today I worked on solving a Quadratic Equation using Python. Instead of just writing code, I focused on understanding the logic behind it. Equation: ax² + bx + c = 0 Key learning from today: ✔ How to convert mathematical formulas into code ✔ Understanding the role of the discriminant (b² - 4ac) ✔ How different values of the discriminant affect the result ✔ Handling edge cases like negative values (using cmath) #100DaysOfCode #Python #ProblemSolving #LearningInPublic
To view or add a comment, sign in
-
-
🚀 Day 13 of My Python + DSA Journey Today’s problem focused on frequency counting 👇 ✅ Majority Element (#169) 💡 Majority Element Find the element that appears more than n/2 times 🔍 Approach: Used hashmap → counted frequency and returned element exceeding n/2 ⏱ O(n) time | O(n) space 🔥 What I learned today: • Hashmaps make counting problems simple • Frequency-based logic is very common in arrays • Early exit improves efficiency Getting faster at recognizing patterns ⚡ #Day13 #LeetCode #Python #DSA #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
#Python threads do not always make code faster. This article explains where threading helps, where it slows things down, and why understanding workload type matters for better performance decisions. #Threading #Blog #Famro #Informational Read more: https://lnkd.in/dKX63JNb
To view or add a comment, sign in
-
-
One student asked me: “Why is my Python code not working?” I checked his code. Logic was correct. Syntax was correct. Still… error. The problem? 👉 One missing colon (:) That day he learned something important: In Python, small details matter. A missing symbol can break everything. From that day, he started: • Reading errors carefully • Checking code line by line • Being patient while debugging That’s how real programmers grow. Not by writing perfect code. But by fixing mistakes. 👉 What was the smallest mistake that caused a big error for you? #BluJayTechnologies #Python #Learning #SoftwareCoaching
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