PINE//OPS
STATUSSTANDBY

Online Python compiler with input

input() reads from the stdin box — one value per line.

stdin (program input)

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

Recon mode — drag to orbit · click to ping · scroll for altitude