TechNoviceTools — Code Tools & Playgrounds

  Python 3 & Built-in Debugger

OnlineGDB Cheat Sheet

Run and debug Python 3 in the browser — no install, no account, no waiting.
The only free online tool that lets you step through your code one line at a time.

Open OnlineGDB

Quick Start — From Zero to Running Code

1
Go to onlinegdb.com/online_python_compiler

Python 3 is pre-selected. You will see a code editor on the left, a toolbar at the top with Run and Debug buttons, and a terminal panel at the bottom right.

2
Paste (or type) your Python code into the editor

Replace the starter code or add below it. The editor shows line numbers, syntax coloring, and flags IndentationErrors with a red underline as you type. Python indentation is strict — use spaces consistently, not tabs.

3
Click the green Run button (triangle/play icon)

OnlineGDB runs your code in the terminal panel at the bottom. Output appears instantly. Any error message includes the line number and a description — read it carefully before changing anything.

4
Program uses input()? Type in the terminal panel

When your code calls input(), execution pauses silently — the terminal cursor will blink, waiting for you. Click inside the terminal panel, type your response, and press Enter. This is the most common source of confusion for first-time users: the program has not crashed; it is just waiting.

5
Share your code with a teacher or classmate

Click the Share link in the top toolbar. Copy the URL. It preserves your exact code for anyone who opens it.

Key Interface Areas

Language Selector — top-left dropdown

The main onlinegdb.com homepage defaults to C. The cheat sheet link goes directly to the Python 3 compiler. If you ever arrive at the wrong language, use this dropdown to switch before running.

Code Editor — main panel

Numbered lines, syntax coloring, and real-time indentation checking. OnlineGDB will underline indentation problems as you type — fix them before clicking Run.

Run Button — green triangle, top toolbar

Runs your program to completion. Output appears in the terminal panel. Use this for everyday “does it work?” runs.

Debug Button — red bug icon, next to Run

Starts the program in debug mode. Execution pauses at the first breakpoint you have set. Use the step controls (Step Over, Step Into, Continue) to walk through your code one line at a time, watching variables change in the Variables panel on the right.

Terminal Panel — bottom of page

Shows program output and receives keyboard input. When input() is called, the cursor blinks here. Click inside and type your response. If you see the cursor blinking and nothing is happening, the program is waiting for you.

Variables Panel — right side (debug mode only)

Visible only when the debugger is running. Shows every variable in scope and its current value — updated at each step. This is the panel that teaches you what your program is actually doing, as opposed to what you think it is doing.

Using the Debugger

The Debugger — Step-by-Step Execution

The debugger is what separates OnlineGDB from every other free online compiler. It lets you run your program one line at a time, pausing after each step so you can see exactly what each variable contains. You will not need this in week one — but you will reach for it the moment you have code that runs without errors yet produces the wrong answer.

1
Set a breakpoint

Click the thin “+” gutter to the left of any line number in the editor. A red dot appears. The program will pause before executing that line.

2
Click the red Debug button

The program runs until it hits your breakpoint, then pauses. The current line is highlighted in the editor. The Variables panel on the right shows all current values.

3
Use the step controls

Step Over executes the current line and pauses at the next. Step Into steps inside a function call. Continue runs until the next breakpoint (or the end of the program).

4
Watch the Variables panel

After each step, the Variables panel updates. The moment a variable holds a value you did not expect — that is the line where the logic error lives. You found it without guessing.

Tips
  • Bookmark the Python URL directly: onlinegdb.com/online_python_compiler — the homepage defaults to C, which will confuse you at 11 p.m.
  • Use the debugger instead of adding print statements when you need to trace variable values. It is faster and cleaner for anything more than one or two variables.
  • No account needed to run or share. Create an account only if you want to save projects permanently.
  • OnlineGDB supports multiple files — click the “+” tab button to add a second Python file, useful when a program spans more than one module.
  • The terminal accepts ANSI color codes in print() output — handy if you want colored text in a Cross Training demo.
Gotchas
The program looks frozen — it’s waiting for input()

When input() is called, the program pauses silently. The terminal cursor blinks but shows no prompt. Click inside the terminal panel and type your value, then press Enter. This is the single most common beginner confusion with OnlineGDB.

Wrong language selected

The main onlinegdb.com homepage opens in C. If you see #include <stdio.h> in the editor, you are in C mode. Use the language dropdown at the top to switch to Python 3 before pasting your code.

IndentationError on the very first run

Python requires consistent indentation — mixing tabs and spaces causes an IndentationError. If you pasted code from a word processor or a PDF, replace all indentation with spaces. Four spaces per level is the Python convention.

Perfect For … / Not the Right Tool When …

Use OnlineGDB When…
  • Running a Cross Training Python snippet without starting VS Code
  • Your program produces the wrong answer and you need to trace exactly why
  • Learning how a loop or function executes step by step — the debugger is the best teacher for this
  • Testing a snippet that uses input() interactively
  • Sharing a runnable Python snippet with a classmate or teacher
Not the Right Tool When…
  • You need to run Java — use JDoodle for Java
  • Building a full project with multiple files and external libraries (use VS Code + pip)
  • Your program makes HTTP requests or opens network connections
  • You need to read or write files on disk
  • You are writing production code — this is a scratchpad, not a workspace