python-basics

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

Python: Functions, def, Parameters, Return Values

You copy five lines of code, paste them into a second spot, then a third, and a week later you fix a bug in one copy and forget the other two. Python functions kill exactly that problem: write a block of logic once, give it a name, and call it wherever you need it. This tutorial covers def syntax, parameters, return values, docstrings, imports, and the call stack, with every example tested. “Functions should do one thing. They should do ... Read More

Python: Dictionaries, CRUD, Methods, and When to Use

A complete Python dictionary tutorial covering creation, CRUD (Create, Read, Update, Delete) operations, methods, iteration, nesting, and the hash table model behind it. Every example is tested on Python 3.14.6 and shows real output, so you can trust what you see. “Dictionaries are the building blocks of Python. Classes are dictionaries. Modules are dictionaries. Namespaces are dictionaries. It’s dictionaries all the way down.” Raymond Hettinger Last Updated: July 2026 | Tested on: Python 3.14.6 | Difficulty: Beginner | Reading Time: ... Read More

Python: Tuples, Immutability, Packing, Unpacking, Named

Complete Python tuple tutorial covering creation, immutability, packing, unpacking, named tuples, and when to choose tuples over lists. Tested examples on Python 3.14.6 with real output. “Immutability changes everything.” Raymond Hettinger, PyCon 2013 Last Updated: July 2026 | Tested on: Python 3.14.6 | Difficulty: Beginner | Reading Time: 15 minutes A Python tuple is like a list that got laminated. Same indexing, same slicing, same looping. But once you create a tuple, it is sealed. You cannot append to it, ... Read More