← the wiki

Input / Output

Input is what goes into a program (keyboard, files, clicks); output is what comes back out (screen, sounds, files).

Every program is a machine with two doors. Through the input door come keystrokes, clicks, files, sensor readings — in Python, input() is the simplest one. Through the output door go text on the screen, saved files, sounds — print() is the classic.

Strip any software down and this is its skeleton: read input, transform it, produce output. A calculator, a search engine, and a self-driving car differ only in what walks through the doors and how clever the transformation is.

The best way to make it stick: watch it run. Start an interactive lesson →