Python

90 articles in this topic

Conditionals in Python: If, Elif and Else with Worked Examples

Learn how Python chooses a branch, then trace exact examples covering Boolean operators, truthiness, nesting, short-circuiting and common mistakes.

Updated 26 Aug 20266 min read60 viewsPython

Python String Methods: A Practical Tutorial With Worked Examples

Stop memorising isolated methods. Trace Python strings through indexing, cleanup, searching, splitting, validation and formatting, with exact results and the traps coding tests use.

Updated 24 Aug 20265 min readPython

Sets in Python: A Complete Tutorial with Worked Examples

Learn how Python sets store unique values, how each core operation works, and how to avoid the errors that catch beginners, with every output worked through.

Updated 30 Oct 20266 min read56 viewsPython

Numbers and Arithmetic in Python: Operators, Precision, and Worked Examples

Understand how Python evaluates numeric expressions, from result types and precedence to negative floor division and floating-point comparison. Runnable examples culminate in one complete practice-session calculation.

Updated 21 Aug 20266 min read50 viewsPython

Python Introduction and Setup Tutorial: Install, Verify, and Run Your First Programs

Set up Python with confidence by checking the command, isolating a project in .venv, and running a saved program whose output you can verify step by step.

Updated 30 Oct 20266 min readPython

Python Functions and Modules: Complete Guide with Worked Examples

Build a reliable mental model for Python functions, scope, imports, and packages, then trace a two-module score report from call to printed result.

Updated 30 Oct 20266 min readPython

Python Tuples Tutorial: Packing, Unpacking, Methods and Examples

Learn how Python tuples work through runnable examples, a fixed-record route program, precise error fixes and four predict-before-running exercises.

Updated 15 Aug 20266 min readPython

Python Lists Tutorial: Create, Update, Slice and Use Lists with Examples

Learn Python lists through one clear path, from creation and indexing to mutation, comprehensions, copying, and exam-style output questions.

Updated 13 Aug 20266 min readPython

Python Dictionaries Tutorial: Syntax, Methods and Worked Examples

Learn how Python dictionaries store, retrieve and transform key-value data through runnable examples, common traps and one complete marks-processing task.

Updated 11 Aug 20266 min readPython

Python Tutorial: The Complete Learning Path, Ordered for Self-Study

Follow Python in a practical order, from your first program to functions, collections, files, OOP, libraries, and the point where DSA should begin.

Updated 9 Aug 20267 min read57 viewsPython

Python String Methods and Formatting: Immutability, Slicing and the Interview Question Patterns

Predict string output by tracking returned values, half-open slices and formatting specifications, then avoid the replace, find, identity and concatenation traps.

Updated 30 Oct 20265 min read59 viewsPython

Python Decorators and Generators: yield, Closures and the Trace-the-Output Interview Questions

See decorators and generators as functions that retain state. Trace a wrapped call, expand @repeat(3), and follow countdown(3) through StopIteration.

Updated 30 Oct 20266 min read60 viewsPython