PyForge · Python practice library
Python · Zero to Hero

Master Python one program at a time.

17 topics · 78 hand-picked programs · a standardised Basic → Intermediate → Advanced path on every page.

Every topic

Standardised format

78+

Practice programs

17 areas

Concepts covered

All topics

Pick any topic — each page has Basic, Intermediate, and Advanced programs.

01

Python Basics

Get started with Python syntax, variables, input/output, how programs are executed, the main method, and your first programs.

print() & input()Variables & typesComments
9 programs
02

Operators

Arithmetic, comparison, logical, bitwise, and assignment operators.

ArithmeticComparisonLogical
4 programs
03

Control Flow

Make decisions with if / elif / else and master conditional logic.

if / elif / elseTernary expressionsmatch / case
4 programs
04

Loops

Iterate with for and while loops, break, continue, and else clauses.

for / whilerange()break & continue
5 programs
05

Strings

Work with text: slicing, formatting, and the most useful string methods.

Indexing & slicingf-stringsMethods (upper, split, join, replace)
5 programs
06

Lists

Ordered, mutable sequences — the workhorse collection in Python.

Indexing & slicingappend/extend/popList comprehensions
5 programs
07

Tuples & Sets

Immutable tuples and unique-element sets — when and why to use each.

Tuple packing/unpackingSet algebraFrozenset
4 programs
08

Dictionaries

Key-value mappings — fast lookups and structured data.

get/setdefaultDict comprehensionsMerging (|)
5 programs
09

Functions

Define reusable logic — arguments, return values, scope, lambdas.

def & return*args / **kwargsDefault & keyword args
5 programs
10

Object-Oriented Programming

Classes, objects, inheritance, polymorphism, and encapsulation in Python.

class & __init__Instance vs class attrsInheritance
5 programs
11

File I/O

Read and write text, JSON, and CSV files safely.

open() & withRead/write modesJSON
4 programs
12

Exception Handling

Handle errors gracefully with try / except / finally and custom exceptions.

try/exceptelse & finallyraise
4 programs
13

Modules & Packages

Reuse code with imports, standard library highlights, and pip.

import / fromAliasesStandard library
4 programs
14

Comprehensions

Build lists, sets, and dicts in one expressive line.

List compSet compDict comp
4 programs
15

Generators & Iterators

Lazy evaluation with yield, generator expressions, and itertools.

__iter__ / __next__yieldGenerator expressions
4 programs
16

Decorators

Wrap functions to add cross-cutting behavior cleanly.

Higher-order functions@decorator syntaxfunctools.wraps
3 programs
17

Regular Expressions

Pattern-match text with Python's re module.

search/match/findallGroupsSubstitution
4 programs