Playground
Pick a language and try an idea. Code runs in this tab, and each language keeps its own saved scratch pad in this browser.
Language
Each language keeps its own saved draft.
Using Python here
- The Python runtime loads on first use and is cached by your browser.
- input() waits for a response. Type in the input field and press Enter; EOF ends input.
- Files you create live in the browser runtime, not on your computer. Threads, subprocesses and raw sockets are unavailable.
- Your edits are stored on this device. Copy or download important work before clearing browser data.
Using JavaScript here
- Use console.log() to show values in the output panel.
- Code runs in a worker. It has no webpage document, prompt() dialog or Node.js environment.
- Use starting values in your code for input. Stop ends a running program; Reset restores the supplied example for this language.
- Your edits are stored on this device. Copy or download important work before clearing browser data.
// Check & run checks the types before executing your code.
// Try replacing 25 with "25" to see a type error.
const sessions: number[] = [25, 10];
let total: number = 0;
for (const minutes of sessions) {
total += minutes;
}
console.log("Total: " + total + " minutes");
Enable JavaScript to edit and type-check this example.
Console output
Using TypeScript here
- Check types shows real TypeScript compiler errors with strict checks. The compiler loads on your first check.
- Check & run executes only after type checking succeeds. Try a wrong type, read the diagnostic, then fix it.
- Code runs in a worker without a webpage document or Node.js. Download .ts saves your current code as a file.
- Your edits are stored on this device. Copy or download important work before clearing browser data.
Using Java here
- The supplied file is Main.java. Keep the public class Main and main method as the frame for your instructions.
- Run compiles and executes a Java 25 subset in your browser. Compiler errors appear in the output panel; a full JDK is not required here.
- For Scanner input, fill the standard-input box before Run. Java reads that supplied buffer and then reaches its end; it does not pause for more input.
- Your edits are stored on this device. Copy or download important work before clearing browser data.