Code labs

  • Updated
  • Code labs (opens in new tab) provide an in-browser coding environment where you can write and run code. Some code labs have tasks which allow you to check your work along the way. 

    See Labs overview for more information about the different types of labs, who can access them, and how to find them.

    Tip: Labs with Guided in the title contain more in-depth guidance and best practices throughout the lab.


    Using code labs

    When you click a code lab, you’re taken directly to an in-browser code editor. The following are the main components of a code lab.

    code lab features

    A. Steps sidebar

    The Steps sidebar contains instructions to follow and/or tasks to complete throughout each step of the code lab.

    • Click the list icon next to the current step’s name to show a table of contents.
    • Use the arrows to navigate between each step of the lab.
    • Click and drag the edge of the sidebar to resize it.

    B. Filetree

    The filetree contains the directories (folders) and files that make up the lab. Click the three dots menu next to a directory or file to modify it.

    Tip: Many labs include a solution file to reference if you get stuck.

    C. Code editor

    The code editor is where you do most of your work. This is a live computing environment to write, run, and view your code.

    D. Tasks and checks

    For some code labs, each step consists of tasks to complete and validate in the coding environment.

    Once you’ve done a task, click Validate to automatically check your work for a pass or fail. Expand Feedback for details and test output. You have unlimited attempts to pass a check.

    Tip: Some labs include a Task Solution for each task that appears after multiple failed attempts at validation. Click Show to see the correct answer to the task.

    show task solution.png

    E. Display and settings

    • Show or hide the Steps sidebar or filetree to maximize space.
    • Click Settings for more layout and coding options, including the ability to download the filetree for use on your local machine or reset the environment.
    • Click Help for in-platform guidance on using the code labs environment.

    F. Progress bar

    The progress bar displays the percentage of the lab you’ve completed.

    Code labs have no time limit and remain open for as long as you’re actively working. After 30 minutes of inactivity, your code lab will shut down. If you close or exit the code lab, your progress will be saved.


    AI code labs

    AI code labs work just like regular code labs, with one key addition: they include built-in access to a large language model (LLM). If you're in an AI-enabled lab, you’ll see an API key and token at the top of the interface, allowing you to send prompts to the model as part of your workflow. This can be useful for getting help with code, generating examples, or exploring solutions in real time.

    For data security, the LLM doesn’t remember previous prompts—so each message you send needs to include all necessary context. These labs connect to the internet only for LLM access—no other browsing or online tools are available. Token and usage limits apply, but no setup is required, and everything you need is included directly in the lab. Code labs with AI functionality are only available in labs where the author has explicitly enabled it. There’s no visual indicator before entering the lab, so you’ll only see AI features once inside.


    Projects

    Projects are a type of code lab that simulates a real-world scenario for you to solve a problem, build onto something that already exists, or create something from scratch.

    Some of our most popular projects include:


    Common questions

    Can I run more than one lab at a time?

    Only one code lab can run at a time. If you want to start a different lab, exit or end your current lab first.

    What should I do if my lab isn’t loading?

    If your lab environment isn’t loading or is slow to load, wait a few minutes. Otherwise, try starting the lab in a different browser.

    Was this article helpful?