python-basics

Python fundamentals for beginners: variables, data types, operators, control flow, and functions, the core syntax every Python program is built on.

Python: Security Basics, Secrets, Input Validation, Dependency Scanning

Secure your Python applications the practical way. This guide walks through the python security best practices every developer should know: validate user input, manage secrets with environment variables, scan dependencies for vulnerabilities, prevent SQL injection, hash passwords with bcrypt, and apply the OWASP (Open Web Application Security Project) basics. “Security is not a product, but a process.” Bruce Schneier, Applied Cryptography Last Updated: July 2026 | Tested on: Python 3.14.6 | Difficulty: Intermediate | Reading Time: 15 minutes Python security ... Read More

Python: Walrus Operator & Modern Features (3.8-3.14)

You compute a value, check it, then use it. Three lines, and you end up calling the same function twice or stashing the result in a throwaway variable. The Python walrus operator := lets you do all three in one step, and it is just the start of a whole batch of modern Python features (dict merge with |, removeprefix(), tomllib, ExceptionGroup, and free-threaded mode) that quietly make your code shorter and clearer. “Easy things should be easy, and hard ... Read More

Python: Closures, Lexical Scoping & Practical Uses

A Python closure is a function that remembers variables from its enclosing scope even after that scope is gone. This post shows how that memory works under the hood: lexical scoping, cell objects, the nonlocal keyword, and why every decorator you will ever write is built on a closure. “The key to understanding complicated things is knowing what not to look at.” Peter Norvig, PAIP Last Updated: July 2026 | Tested on: Python 3.14.6 | Difficulty: Intermediate | Reading Time: ... Read More