Running Python programs that ask for input
Many online runners fail on input(). Here, open the stdin panel under the editor, enter one value per line, and press Run. Each input() call consumes the next line, exactly as if you had typed it in a terminal.
n = int(input())
print(sum(int(input()) for _ in range(n)))
With stdin set to 3, 10, 20, 30 on separate lines, this prints 60.
Frequently asked questions
What happens if the program asks for more input than I provided?
Python raises EOFError, the same as a terminal whose input has ended. Add more lines to the stdin box and run again.
Does the prompt text appear?
Yes, the prompt passed to input("…") is written to the console.
Related tools
- Pine compilerCheck, run and chart v4 · v5 · v6 scripts in your browser — nothing to install, nothing uploaded.
- PythonPython 3 via WebAssembly — runs on your device.
- Python data sandboxNumPy and pandas, loaded on demand, running locally.
- JavaScriptSandboxed Web Worker with top-level await.
- TypeScriptTranspiled by the real TypeScript compiler, then executed.
- LuaLua 5.3 on the Fengari VM.
- SQL (SQLite)A real SQLite engine in WebAssembly — fresh database every run.
- HTML / CSS / JSLive preview in a sandboxed frame.