Skip to content

ckdbtech

  • Home
  • About Us
  • Contact Us

Blog Post #99: Documenting Your Code: The Power of Docstrings

October 4, 2025 by Debjeet Bhowmik

As we write more functions, our programs become more complex. While our code might make perfect sense to us the moment we write it, it can be nearly incomprehensible to others—or even to ourselves six months from now. Good code is not just code that works; it’s code that is understandable. In this post, we’re … Read more

Categories python Leave a comment

Blog Post #98: Decoding Python’s Variable Lookup: The LEGB Rule

October 4, 2025 by Debjeet Bhowmik

In our previous posts on scope (Post #94, #95, and #96), we’ve seen that variables can exist in different “workspaces”—primarily the local scope inside a function and the global scope outside of any function. But what happens when you use a variable name? How does Python decide which variable you’re referring to, especially if the … Read more

Categories python Leave a comment

Blog Post #97: Modifying the Outside World: The global Keyword

October 4, 2025 by Debjeet Bhowmik

In Post #96, we ran into a puzzle. When we tried to change a global variable from inside a function, we instead created a new “shadow” local variable, and the original global variable remained untouched. This is Python’s default behavior, designed to protect your global scope from accidental changes by functions. But what if you … Read more

Categories python Leave a comment

Blog Post #96: The Big Picture: Understanding Global Scope

October 4, 2025 by Debjeet Bhowmik

In Post #95, we did a deep dive into the “local scope”—the private, temporary workspace inside a function. We learned that local variables are created when a function is called and destroyed when it finishes. Now, let’s zoom out from the “inside of the box” to look at the big picture. In this post, we’ll … Read more

Categories python Leave a comment

Blog Post #95: Inside the Box: Understanding Local Scope

October 4, 2025 by Debjeet Bhowmik

In Post #94, we introduced the concept of variable scope and made a key distinction between the “outside” global scope and the “inside” local scope of a function. We saw that variables created inside a function are hidden from the outside world, creating a protective boundary. In this post, we will take a closer look … Read more

Categories python Leave a comment

Blog Post #94: An Introduction to Variable Scope

October 4, 2025 by Debjeet Bhowmik

In our journey through Part 4, we’ve learned how to pass data into functions as arguments and get data out of them using return. Now we need to ask a fundamental question: what happens to the variables we create inside a function? Where do they live, and who can see them? This brings us to … Read more

Categories python Leave a comment

Blog Post #93: Returning Multiple Values at Once

October 4, 2025 by Debjeet Bhowmik

In Post #91, we learned how to use the return statement to send a single value back from a function. In Post #92, we saw that if we don’t return anything, the function implicitly returns None. This covers returning one value or no value, but what if a function needs to send back multiple pieces … Read more

Categories python Leave a comment

Blog Post #92: What Happens When You Don’t Return? The None Type

October 4, 2025 by Debjeet Bhowmik

In Post #91, we learned how to use the return statement to send a calculated value back from a function. This is essential for functions that are designed to produce a result that can be stored in a variable or used in further calculations. But this raises an interesting question: what about the functions we … Read more

Categories python Leave a comment

Blog Post #91: Getting Data Back: The return Statement

October 4, 2025October 3, 2025 by Debjeet Bhowmik

Up to this point, our custom functions have performed actions—they’ve printed banners or messages to the console. They do things, but they don’t give us anything back that we can store and use later in our program. What if we want a function to perform a calculation and hand us the result? How do we … Read more

Categories python Leave a comment

Blog Post #90: The Mutable Default Argument Pitfall: A Common Beginner Mistake

October 3, 2025 by Debjeet Bhowmik

This post covers what is arguably one of the most famous and confusing “gotchas” in the Python language. In Post #89, we learned how to use default parameter values, which is a fantastic feature for making functions more flexible. However, using a mutable type (like a list or a dictionary) as a default can lead … Read more

Categories python Leave a comment
Older posts
Newer posts
← Previous Page1 … Page5 Page6 Page7 … Page27 Next →
  • ai (50)
  • bash (8)
  • cheatsheet (2)
  • git (6)
  • gitlab (17)
  • kubernetes (1)
  • python (149)
  • terraform (31)
Recent Posts
  • Blog Post #149: Writing and Appending to Text Files
  • Blog Post #148: The Best Way to Read Large Files: Iterating Line-by-Line
  • Blog Post #147: Reading from Files: .read(), .readline(), and .readlines()
  • Blog Post #146: Controlling File Access: A Guide to File Modes (r, w, a, x)
  • Blog Post #145: The Pythonic Way to Handle Files: The with open() Statement
  • Blog Post #144: Understanding File Paths: Absolute vs. Relative
  • Blog Post #143: Your Program’s Memory: An Introduction to Data Persistence
  • Blog Post #142: Part 5 Recap & Project: Refactoring to Pythonic
  • Blog Post #141: Practical Decorator Example: A @logger for Debugging
  • Blog Post #140: Practical Decorator Example: A @timer to Measure Execution Time
  • Blog Post #139: Understanding Decorators, Part 3: The @ Syntax
  • Blog Post #138: Understanding Decorators, Part 2: Manually Wrapping a Function
  • Blog Post #137: Understanding Decorators, Part 1: Functions are Objects
  • Blog Post #136: A Quick Look at itertools
  • Blog Post #135: Don’t Reinvent the Wheel: any() and all()
  • LinkedIn
  • Facebook
  • Twitter
  • RSS Feed

FooterMenu

  • Privacy Policy
  • Disclaimer
  • Terms of Use
© 2025 ckdbtech