Learn Python by running it.

Change one line, press Run and see what happens. Nothing to install and no account needed.

Today's code · Friday

Fuel check

Press Run to see the output here.

Try 20, 50 and 90 and watch the answer change. Open the full editor →

Newest articles

Discover the latest in space science and Python programming. Our newest articles blend astronomy concepts with coding challenges to fuel your cosmic curiosity.

All articles →
A robot standing next to a Japanese restaurant, the cover image for an article on whether learning Python is still worth it in the age of AI

Is It Worth Learning Python in the Age of AI? (2026)

AI now writes a large share of new code, so is learning Python still worth your time? Yes, but for a different reason than ten years ago. Using job data, developer surveys and recent studies on learning with AI, we look at what changed and where Python’s

Beginner’s guide to Python functions: code example with def, parameters and return

Python Functions for Beginners

Learn to write your own Python functions, from your first def to return values, default parameters and scope, with runnable examples, common mistakes and six practice projects.

Converting decimal numbers to Rocky's base-6 Eridian number system in Python

Base 6 Number System in Python

In Project Hail Mary, the alien engineer Rocky counts in base 6 because he has two hands with three fingers each. In this article, you'll build Python programs that convert between decimal, base-6, and Eridian notation.

New in the community forum

Questions and answers from other people learning Python.

Go to the forum →

Quiz of the week

A different quiz every Monday. How many will you get right?

All quizzes →

Today's challenges

Three challenges, different every day. Fix or write the code and let the tests check it.

All challenges →

Line to record

Extend the feed parser so it stores every reading as a dict with time, sensor, value and unit in a list of records, then let other code pick out one sensor's readings by key.

  • Write the code
  • Easy
  • 2 stages

API response

Print the name, provider and status of a launch from a dict shaped like a launch-API response, then list every field the response has with items(), the way you'd inspect an API you haven't used before.

  • Write the code
  • Easy
  • 2 stages

Missing field

Reading launch["pad"] stops with a KeyError when the API hasn't assigned a pad yet. Predict it, check the keys with in, fix it with get() and a default, then print a list of launches with defaults for any missing field.

  • Fix the code
  • Easy
  • 3 stages

Today's examples

Three short programs to read, run and change. A new set tomorrow.

All examples →

Return Statement Basics

Return statement returns a value from function. Function can perform calculations and give result.

  • Audio
  • function
  • return
  • value

Returning Multiple Values

Function can return multiple values as a tuple. Unpacking on assignment.

  • Audio
  • function
  • return
  • tuple

Join the programmers learning Python here

A free account saves your progress on paths, quizzes and challenges, keeps the code you write, and lets you ask and answer in the community.