Hussain Compiler

A friendly place to learn Python

Welcome to Hussain Compiler

Learn Python one idea at a time. Follow guided courses, try each example in the browser editor, and build confidence by changing the code and seeing what happens.

Screenshot of the Hussain Compiler editor showing Python code and the browser terminal

Learn at your own pace

Guided Python courses

Choose a path that matches what you want to learn. Each course includes explanations, examples, practice tasks, and progress saved in your browser. Open the editor and select the Courses icon to continue with the original lessons.

Beginner

Python Basics

Start with output, variables and types, strings, decisions with if, and loops.

Beginner to Intermediate

Data Structures and Functions

Practice lists, dictionaries, functions, list comprehensions, and handling errors.

Intermediate

Intermediate Python

Explore classes, inheritance, standard-library modules, JSON, generators, and lambdas.

Beginner

Weeks 1–6 Lab Companion

Reinforce foundational lab topics with guided exercises and runnable code.

Open the editor and start a course

A preview from the lessons

Learn the idea, then try it

These examples introduce a few of the ideas covered in the courses. In each one, run the code, change a value, and check whether the result matches your prediction.

Variables and types

A variable stores a value under a name. Text and numbers behave differently: "14" is text, but 14 can be used in arithmetic.

price = 12
quantity = 3
total = price * quantity
print("Total:", total)

Practice: Change the price and quantity. What happens to the total?

Decisions with if

Python checks a condition and runs the indented branch that matches. The order of comparisons matters when the conditions overlap.

score = 85
if score >= 50:
    print("Pass")
else:
    print("Try again")

Practice: Try scores of 49 and 50. Notice where the result changes.

Loops and totals

A loop repeats an instruction for each value. range(1, 6) stops before 6, so the loop visits 1 through 5.

total = 0
for number in range(1, 6):
    total += number
print(total)  # 15

Practice: Change the range to add the numbers from 1 through 10.

Functions and return values

A function names a reusable task. return sends a result back so you can use it in another part of the program.

def area(width, height):
    return width * height

print(area(6, 7))

Practice: Call the function with a different width and height and predict the output.

Learn by doing

A simple way to practice

Read a short explanation

Each lesson introduces one idea and shows how Python uses it.

Run and change the example

Try the code, change a value, and predict how the output will change.

Complete a small task

Use the hint when needed, then compare your result with the expected behavior.

Python in your browser

The editor runs Python using Pyodide and WebAssembly. It is designed for learning and short experiments, uses the Python standard library, and does not install third-party packages. Your workspace and course progress are saved in this browser. Download files you want to keep elsewhere. An internet connection is needed to load the editor and Python runtime.

Common questions

Do I need to install Python?

No. The editor loads a Python runtime in your browser. You do need an internet connection to load the runtime and interface resources.

Where do my files and course progress go?

They are saved locally in this browser and are not synchronized to an account. Download any files you want to keep as a separate copy.

Can I install third-party packages?

No. Package installation is not available, so examples requiring external packages may not work in this editor.

Does this create executable files?

No. It runs Python code in your browser and lets you download source files; it does not create native executables.