Skip to content
LearnPY
Start here

Start here: how LearnPY works

A four-minute orientation to the lessons, the code runner, and the habits that make practice stick.

4 min readbeginner

By the end

  • Describe how a LearnPY lesson is structured.
  • Run Python in the browser and read the output.
  • Know what to do when a cell raises an error.

What this site is

LearnPY is a small, focused curriculum for Python's data stack. Each lesson gives you one mental model, a few short examples, and a place to run real code. Everything executes in your browser, so there is nothing to install and no account to create.

  • Lessons are short on purpose. Finish one idea, then move on.
  • Code is real Python. The arrays, tables, plots, and models are the same ones you would use locally.
  • You can edit every runnable example. Change a value, break it, and run it again.

The loop you will repeat

Most lessons follow the same rhythm. It is deliberately boring: read a little, type a little, check the result. That loop is what turns syntax you recognize into code you can write.

  1. Read the explanation and predict what the code will do.
  2. Run the example, then change one thing and run it again.
  3. Work through the exercise without copying the solution.
  4. Answer the quiz question and read the explanation, even when you get it right.
  5. Use the reference pages when you need a signature instead of a lesson.
pythonA loop you can already read
for value in [3, 6, 9]:
    print(value * 2)

Output

6
12
18

Run your first cell

The panel below is a live Python session. Press Run to execute it. The first run downloads the Python runtime and can take a few seconds; later runs reuse the same session and start immediately.

Python

Your first cell

Ready
Loading editor…

Output

Press Run to execute this cell. The first run downloads Python; later runs reuse the session.

The last line is an expression, so the runner shows its value separately from the printed output. That mirrors the behavior of a notebook: print what a reader needs, and leave the final expression for a quick look.

What each track covers

The four tracks share one vocabulary. NumPy introduces arrays, pandas builds labeled tables on top of them, Matplotlib turns values into charts, and scikit-learn turns clean tables into models. Taking them in that order makes each track easier.

TrackWhat you will practiceWhen to take it
NumPyArrays, broadcasting, indexing, random numbers, linear algebraFirst
pandasDataFrames, selection, grouping, joins, cleaningAfter NumPy basics
MatplotlibFigures, axes, layouts, styling, subplotsAlongside pandas
scikit-learnPreprocessing, regression, classification, clustering, metricsAfter pandas and NumPy
The four tracks at a glance

When something breaks

An error is information, not a verdict. Read the last line first: it names the error. Then scan upward for the line number in your code. Most beginner errors come from a missing quote, a missing colon, inconsistent indentation, or a name that was never defined.

  • NameError means Python has not seen that variable yet. Check spelling and whether the defining line ran.
  • IndentationError means the block structure is off. Use four spaces per level and do not mix tabs.
  • ModuleNotFoundError usually means the package was not loaded. Lessons load what they need, but imports still have to be written.

What comes next

You do not need to memorize this page. Start the NumPy track, keep the reference pages nearby, and come back here whenever you want a reminder of how the lessons fit together.

Practice

Make it stick

Run the tests as often as you like. Hints and the solution are available when you need them.

Exercise

Add the new reading of 20 to the list, then compute the updated average.

Your solution

Ready
Loading editor…

Results

Run the tests to check your solution. The first run downloads Python; later runs reuse the session.

Quiz

Check your understanding

01You need to clean a messy CSV and compute totals by category. Which track should you open next?
02Where does the code in a runnable cell execute?

Lesson progress