Getting started with coding exercises
Coding exercises are interactive Python challenges you can solve right in your browser. You write real code, run it against automated tests, and get instant feedback, all without installing anything on your computer.

Where to find exercises
You'll run into coding exercises in three places:
- Courses: Many courses include hands-on exercise lessons between lessons. The course page lists how many exercises a course contains under "Course Materials."
- Tutorials: Some written tutorials embed exercises so you can practice a concept right after reading about it. (Coming soon!)
- The Library: Use the "Coding Exercises" filter in the library to browse all exercises, and filter by difficulty level.
Every exercise shows a difficulty badge: Basics, Intermediate, or Advanced. Click the badge to find more content at that level.
A tour of the exercise workspace
Each exercise has three main areas:
- The content tabs (Instructions, Hints, Solution): Start with the Instructions tab. It explains the task and what your code needs to do.
- The code editor: A Python editor pre-filled with starter code. This is where you write your solution. Look for
...placeholders, which mark the spots you need to fill in. - The test results sidebar: A list of the tests your code has to pass. Before your first run, every test shows as pending.

Need more room? Click the expand button in the top-right corner (or press t) to switch to full-width mode. Press Esc or click the button again to exit.

Running your code
When you're ready to check your work:
- Click Run Tests, or press Ctrl+Enter (Cmd+Enter on a Mac) while in the editor.
- Your code runs on our servers in a secure sandbox. This usually takes a second or two.
- Each test in the sidebar turns green (passed) or red (failed), with a progress bar summarizing your results.

You can run tests as often as you like. There's no penalty for failed attempts, so experiment freely. If a test fails, click it to see the details: what input was used, what result was expected, and what your code actually produced.
You need to be signed in to run code. Reading the instructions works without an account, but the first time you click Run Tests you'll be asked to log in (a free account is enough for exercises in free tutorials).
Required vs. bonus tests
Some exercises include bonus tests, marked with a "Bonus" badge in the sidebar. Here's how they work:
- Required tests are the core of the exercise. Pass all of them and the exercise counts as completed. You'll see a "Completed" badge and, in a course, the lesson is marked done.
- Bonus tests are optional stretch goals for extra practice, often covering edge cases or a more elegant approach. They never block completion, but passing all of them earns you the full celebration.
