Skip to content
BENIBIX Learn

Input and Output

Development🧩 Programming ConceptsPrograms

Also known as I/O, IO

What goes into a program, and what comes out. Short form: I/O.

Think of it like

Think of it like a juice maker. Fruit goes in the top, and juice comes out the spout.

Example

A weather app takes a city name as input. Its output is the forecast for Tokyo, shown on the screen.

Why it matters

A program with no input does the same thing every time. A program with no output does nothing you can see.

Definition

Input is anything a program takes in, and output is anything it gives back. A key press, a click or a file can be input. Words on a screen, a sound or a saved file can be output. Almost every program follows the same shape: take input, work on it, give output.

Example code

python
>>> name = input("Your name? ")
Your name? Jack
>>> print("Hi, " + name)
Hi, Jack
The name Jack types is the input. The greeting is the output.

Common mistake

Thinking input only means typing. A sensor, a file, a network message and a clock are all input too.

Key takeaways

  1. 1
    In, work, out. Most programs take in, change, then give back.
  2. 2
    Many kinds. Keys, files, screens and sounds all count.
  3. 3
    Check what comes in. Bad input is a common cause of bugs.

Learn it properly