🚀 Day 18 of my #100DaysOfCode Journey – Exploring Python Modules 🐍 Today’s focus was on Python Modules, both built-in and custom! Here’s what I practiced: ✅ Standard Library (math module) – Calculated square root, factorial, and rounded pi value. ✅ Random Module – Generated random choices and shuffled lists dynamically. ✅ Custom Module – Created my own calculator.py with add() and sub() functions, then imported it into the main file. 💡 Key Takeaway: “Modules make Python more powerful, organized, and reusable — write once, use everywhere!” #Python #100DaysOfCode #Modules #LearningJourney #SoftwareDevelopment #CodingEveryday #Math #Random #CustomModules #CodeNewbie
"Day 18: Mastering Python Modules for #100DaysOfCode"
More Relevant Posts
-
🚀 Day 18 of my #100DaysOfCode Journey – Exploring Python Modules 🐍 Today’s focus was on Python Modules, both built-in and custom! Here’s what I practiced: ✅ Standard Library (math module) – Calculated square root, factorial, and rounded pi value. ✅ Random Module – Generated random choices and shuffled lists dynamically. ✅ Custom Module – Created my own calculator.py with add() and sub() functions, then imported it into the main file. 💡 Key Takeaway: “Modules make Python more powerful, organized, and reusable — write once, use everywhere!” #Python #100DaysOfCode #Modules #LearningJourney #SoftwareDevelopment #CodingEveryday #Math #Random #CustomModules #CodeNewbie
To view or add a comment, sign in
-
-
Day 41 – Scope in Python: Local vs Global Variables Ever got a “NameError” and wondered why Python couldn’t find your variable? 🤔 It’s all about Scope — where a variable lives and breathes. x = 10 # Global variable def show(): x = 5 # Local variable print("Inside function:", x) show() print("Outside function:", x) 🧩 Output: Inside function: 5 Outside function: 10 ➡️ Local variables exist only inside the function. ➡️ Global variables exist everywhere. Use them wisely — globals are powerful but can cause confusion if overused. 👉 Tip: Prefer local scope for clean and bug-free code. #Python #Coding #Learning #100DaysOfCode #PythonTips
To view or add a comment, sign in
-
Ever noticed how Python behaves weirdly sometimes? a = 256 b = 256 print(a is b) # True x = 257 y = 257 print(x is y) # False Wait… what? Both pairs “look” the same, but Python only thinks the first pair is identical. Here’s why 👇 Python caches small integers from -5 to 256 in memory (a mechanism known as integer interning). This means whenever you create any number in that range, Python points to the same memory address. So a is b returns True. But for numbers outside that range, Python creates new integer objects, even if the values match. That’s why x is y returns False — they are equal in value, not identical in memory. This tiny detail showcases Python’s clever optimization tricks — saving memory and speeding up simple number operations! #Python #CodingTips #DataScience #MachineLearning #PythonInternals #LearningEveryday
To view or add a comment, sign in
-
🚀 Big news for the Power Platform ecosystem! Microsoft just enabled Python execution directly within Power Platform — a massive leap for automation, analytics, and AI integration. 💡 Why it matters: For business users: This means you can now access advanced data transformation, AI, and visualization capabilities without leaving Power Apps or Power Automate. Think predictive analytics, natural language models, and data science workflows — all in one low-code environment. For developers: It bridges low-code and pro-code like never before. You can now reuse Python scripts, leverage existing libraries (Pandas, NumPy, OpenAI, etc.), and supercharge Power Platform solutions with real computation power. For organizations: Expect faster innovation, less dependency on external pipelines, and more value extracted from your data — directly within Microsoft’s governance and security layer. This is the convergence of low-code + pro-code + AI, and it’s going to reshape how we build and automate business solutions. 🔥 #PowerPlatform #Python #AI #Automation #DataScience #LowCode
Microsoft MVP | Helping teams go beyond low-code limits | Senior Software Engineer | Dynamics 365, Power Platform & Azure
we finally have real code, because #Python just became available inside #PowerPlatform and this a game changer… the new #Code #Interpreter feature just dropped, you can enable it in your environment, flip the switch in settings, and suddenly the instruction type shows a new #Code view, that’s the interpreter also output dropdowns now show documents and images, not just json or plain text... you can see the python generated from your prompt but unfortunately is not editable yet... but that’s the direction it seems to be going, and it will result in more deterministic outputs, less prompt magic you will be able to write clean and predictable logic... it can be used in #CopilotStudio as well, but i see most value in #PowerAutomate what’s the first thing you’d replace with python?
To view or add a comment, sign in
-
Nesting three loops and translating that into a single list comprehension can be a little bit tricky. Today I tackled a fun Python challenge using list comprehensions, and I found it super interesting! I generated all combinations [i, j, k] within given ranges where the sum isn’t equal to a target value n. It really stretched my thinking about nested loops and concise Python syntax. Example output (for x=1, y=1, z=2, n=3): [[0, 0, 0], [0, 0, 1], [0, 1, 0], [1, 0, 0], [1, 1, 0], [1, 0, 1], [0, 1, 1]] If you’ve solved similar combinatorics or Python list comprehension problems, I’d love to hear your approach! #Python #Coding #LearningInPublic #100DaysOfCode #ProblemSolving #ListComprehension #BeginnerToBuilder
To view or add a comment, sign in
-
I discovered this after 2 years of using Python... I can’t believe I missed it! Try the following in Python: 👉 round(4.5) will return 4 👉 round(5.5) will return 6 One rounds down, the other rounds up! “But wait, shouldn’t the rule always be the same?” “If it’s .5, it should round up!” => That used to be the case until Python 3… But then they switched to a logic called “banker’s rounding.” The idea is simple: If you always round up, over millions of calculations the result becomes biased. Python 3.0 (and later versions) eliminates this bias: → If the number is even, it rounds down → If it’s odd, it rounds up Just goes to show, we’re always learning, and it’s worth revisiting the basics! #python #data #datascience #dataengineering
To view or add a comment, sign in
-
-
Super interesting! This is what you get when you combine lack of mathematical rigor with under-specification of business problems: irrational tradeoffs in a language implementation. As far as I can tell we have a very clear and specific understanding of what Math.round is supposed to do. If that well-defined behavior leads to undesired aggregated effects in a specific context, then the problem domain should be further investigated. If the odd/even strategy is a valid solution, than this solution should be applied in that context (e.g. by overriding, or even better by providing a very clearly documented alternative). oh well, never a dull moment in the life of an engineer I guess 😄.
💻 Senior Data Engineer & Backend Architect | 21+ yrs building scalable data/AI systems | Python, Go, Java/Spring | Databricks & Snowflake expert | Driving EU Gov & Enterprise success | Open to EU roles
I discovered this after 2 years of using Python... I can’t believe I missed it! Try the following in Python: 👉 round(4.5) will return 4 👉 round(5.5) will return 6 One rounds down, the other rounds up! “But wait, shouldn’t the rule always be the same?” “If it’s .5, it should round up!” => That used to be the case until Python 3… But then they switched to a logic called “banker’s rounding.” The idea is simple: If you always round up, over millions of calculations the result becomes biased. Python 3.0 (and later versions) eliminates this bias: → If the number is even, it rounds down → If it’s odd, it rounds up Just goes to show, we’re always learning, and it’s worth revisiting the basics! #python #data #datascience #dataengineering
To view or add a comment, sign in
-
-
Python Tip – Day 6: Make Your Loops Cleaner with enumerate() Ever used range(len()) to get both index and value in a loop? There’s a better and more Pythonic way , use enumerate()! Here’s a quick example: x = [1, 2, 3, 4, 5, 6] s = 0 for i in enumerate(x): print(i[0], i[1]) enumerate() returns both the index and value as a tuple! That’s why i[0] gives the index and i[1] gives the list element. Try unpacking it directly for cleaner code: for index, value in enumerate(x): print(index, value) enumerate() improves readability and makes your code look more professional. Keep your loops clean and efficient! #Python #30DaysOfpythonCode #PythonTips #CodingJourney #LearnPython #CodeBetter
To view or add a comment, sign in
-
-
👩💻 “That’s not very Pythonic…” We’ve all heard that phrase before. But what does it actually mean? This week I took a small, messy Python script and refactored it step by step, each time applying a principle that makes the code more Pythonic: 🔁 Replacing classes with functions 🧼 Using @dataclass for structure 📎 Adding type annotations 🧘 Embracing the Zen of Python ... and more! 👉 Watch here: https://lnkd.in/gaCp34fC #python #cleancode #refactoring #zenofpython #pythonic #arjancodes
To view or add a comment, sign in
-
-
I continued my Python learning journey and explored some key fundamentals: 🔹 Understanding Data Types – strings, integers, floats, booleans, and how Python handles them. 🔹 Performing Type Checking & Type Conversion – using type(), int(), float(), and str() to manage data effectively. 🔹 Practiced Number Manipulation & f-Strings – improved how I format and display results cleanly in Python. To apply what I learned, I created two small practice tasks: ✅ BMI Calculator – to calculate Body Mass Index based on user input. ✅ Tip Calculator – to split bills smartly among friends. Every small project builds confidence and improves logical thinking. 🚀 #Learning #WebDevelopment #Python #KeepGrowing #100DaysOfCode
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