GCSE and A-level Computer Science

Python for GCSE Computer Science, in the browser

Students can write and run Python 3.14 below with no account, no install and no ads, on a Chromebook or any school computer. This page covers what a class can do with it, how it fits each exam board, and what it can't do.

By the OnlineCompiler.io team. Updated .

# Validate a mark, then look up its result
BOUNDARIES = [70, 55, 40]
RESULTS = ["Distinction", "Merit", "Pass"]


def result_for(mark):
    for i in range(len(BOUNDARIES)):
        if mark >= BOUNDARIES[i]:
            return RESULTS[i]
    return "Fail"


mark = int(input("Enter a mark (0 to 100): "))
while mark < 0 or mark > 100:
    print("Invalid mark, try again")
    mark = int(input("Enter a mark (0 to 100): "))
print("Result:", result_for(mark))
Share gives a link, no account needed. Save keeps it in your account.

The example is a validation loop, which all four GCSE specifications expect students to be able to write. Its input is already in the Input tab: 105, which it rejects, then 64. Change the numbers and press Run. A short program like this takes about 0.56 seconds to run on our servers.

What a class can do with it

  • Run Python with no accounts. Students open this page or the Python online compiler and start typing. The code runs on our servers, so there is nothing to install and it works the same on Chromebooks, tablets and school PCs. If your web filter blocks it, ask IT to allow onlinecompiler.io and api.onlinecompiler.io.
  • Hand work in with a link. Share gives a link to the code and its input that anyone can open and run, with no account. Students paste it into Google Classroom, Teams or an email. Links made without an account last 90 days; Save keeps code in an account for as long as the student wants it.
  • Put the editor in your own pages. Sign in, create a widget key on the Widgets page of your dashboard, and the embed builder turns your starter code into an iframe. In Google Sites, use Insert, Embed, Embed code and paste it; in an LMS or VLE, paste it into any page that accepts an iframe. The embeddable code editor page shows the script version for sites that allow scripts, with hidden starter code and answer checking.
  • Practise against expected output. The online compiler with test cases runs a program against up to 8 inputs at once and marks each one passed or failed, the way an exam task's sample output is checked. Prompts count as output, so either include them in the expected output or leave them out of input() for these exercises.
  • Mark submissions automatically. If your school runs its own course site or scripts, the autograder API runs each student's program against your tests, including hidden ones, and returns a score. Schools on Moodle can point CodeRunner at it instead of running a Jobe server.

Moving off Trinket? The Trinket alternative page covers swapping old Trinket links and embeds.

How it fits each exam board

Every board below uses Python, but they test it in different ways. Two of the GCSE exams are taken on screen in the school's own IDE, offline, so this site is for lessons and homework rather than the exam itself.

QualificationHow Python is assessedUsing this site
AQA GCSE (8525)Paper 1 is a written exam of 2 hours. Schools enter students for Python 3, C# or VB.NET, and students write code in that language on paper. Paper 2 includes SQL.Practise the Paper 1 programming tasks here. Schools on the other options can use the C# and Visual Basic pages, and the SQL online compiler runs SQLite 3 for Paper 2.
OCR GCSE (J277)Paper 2 is written, 1 hour 30 minutes. In Section B (30 marks) students write or refine code in OCR Exam Reference Language or a high-level language such as Python.Write the Section B style tasks in Python and run them to check the logic before writing them out by hand.
Pearson Edexcel GCSE (1CP2)Paper 2 is an onscreen exam of 2 hours and 75 marks in Python 3, in the IDE the school chooses, with no internet access. Students get code files and the Programming Language Subset. The June 2025 examiners' report describes fixing errors, completing code, a Parsons problem, comment-first coding and an open problem, and one question used turtle.Everything in the subset runs here except turtle, including file handling, random, math and time. Students still need practice in the exam IDE, and turtle practice needs an IDE with a window.
Eduqas GCSEComponent 2 is an on-screen exam of 2 hours and 80 marks in Python 3, based on a scenario issued the September before. It includes simple GUIs (text boxes, buttons, forms) built with Python's own libraries.Text-based tasks run here. GUI work with tkinter doesn't: there is no screen to draw on.
A-level (AQA 7517, OCR H446)AQA's Paper 1 is on-screen, with a skeleton program issued in C#, Java, Python or VB.Net. OCR's H446 includes a programming project.All four AQA languages run here (Java is OpenJDK 25), and a single file of up to 100 KB fits. Bigger projects with several files, a GUI or a database belong in a full IDE.

What it can't do

  • No turtle, tkinter or Pygame. Programs run on a server with no screen, so these fail to import. Matplotlib charts do work: plt.show() shows the chart under the output.
  • Input is typed before the program runs. Students put every answer in the Input tab, one per line and in order, then press Run. The program can't wait for more while it runs, and asking for more lines than were typed stops it with an EOFError. The prompts appear in the output without the answers after them, as in the example above.
  • Output appears when the program ends. time.sleep works, but a countdown prints all at once rather than one line a second.
  • Files last for one run. A program can write a file and read it back, but nothing is kept afterwards and there is no way to attach a data file in the editor. For file handling practice, write the file first in the same program:
scores.py
# The editor can't attach a file, so write one first
file = open("scores.txt", "w")
file.write("Ada,91\n")
file.write("Grace,78\n")
file.close()

file = open("scores.txt", "r")
for line in file:
    fields = line.strip().split(",")
    print(fields[0], "scored", int(fields[1]))
file.close()
  • Limits per run: 30 seconds, 512 MB of memory and no internet access, so pip install can't download anything. That is plenty for GCSE tasks.
  • No classes or tracking. There are no class lists, assignments or teacher view of students' work. Students hand work in by sharing a link.
  • Your own embeds share your account's limits. On the free plan, a widget key takes 30 runs a minute and 8 waiting at once across all your students. A class pressing Run in the same moment can go over that; those students see a message and can press Run again a few seconds later. The pricing page lists the paid plans' limits.
  • A Google Sites embed needs its own key. Google Sites shows embedded code in a frame of its own rather than on your site's address, so a key restricted to your school's domain is refused there. Make a separate key with no domain for Google Sites. You can turn any key off on the Widgets page.

An iframe for one exercise looks like this; the code and its input travel in the part after the #:

Google Sites: Insert, Embed, Embed code
<iframe src="https://api.onlinecompiler.io/embed/?key=YOUR_WIDGET_KEY&amp;lang=python-3.14&amp;theme=light#code=name%20%3D%20input(%22What%20is%20your%20name%3F%20%22)%0Aprint(%22Hello%22%2C%20name)&amp;input=Ada"
  title="Python exercise" width="100%" height="420" style="border: 0" loading="lazy"></iframe>

What is stored

Students don't sign in and the editor asks for no names. Each run is kept in execution history with its code, input, output and the IP address it came from, as for every run on this site, and a shared link keeps its code and input until it expires. The site uses Google Analytics to count visits. The privacy policy and security page say exactly what is kept and for how long; share them with your school's data protection lead before you roll the site out to a class.

Frequently asked questions

Is it free for schools?

Yes. Students run Python on this page and on the Python online compiler with no account and no ads. If you embed the editor in your own pages, your free account covers 100,000 runs a month across all of them, with no credit card.

Do students need an account?

No. They only need one to keep code in an account with Save. Share works without an account and gives a link that lasts 90 days.

Does it work on Chromebooks?

Yes. The code runs on our servers, so nothing is installed and any up-to-date browser will do, including on Chromebooks and tablets. If your school filters websites, ask IT to allow onlinecompiler.io and api.onlinecompiler.io.

Can students run turtle graphics or tkinter?

No. Programs run on a server with no screen, so import turtle and import tkinter fail. Edexcel includes turtle in its Programming Language Subset and Eduqas includes simple GUIs, so those topics need IDLE, Thonny or another editor that can open a window.

Which version of Python is it?

CPython 3.14 with the full standard library. Everything in Edexcel's Programming Language Subset runs on it apart from the turtle module.

Why do the prompts and answers run together in the output?

Students type all the input in the Input tab before pressing Run, one answer per line. The program prints its prompts but not the answers, which come from the Input tab, so "Enter a mark: " is followed straight away by whatever the program prints next.

Can students use it in the exam?

No. Edexcel and Eduqas run their on-screen papers in an IDE on the school's own computers, and Edexcel says students must not have internet access. Use this site for lessons and homework, and make sure students also practise in the IDE they will use in the exam.

How do students hand in their code?

They press Share and paste the link into Google Classroom, Teams or an email. You open the link and run their code. Links made without an account last 90 days.