# Input and Output

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

**Field:** Software Development  
**Category:** Programming Concepts  
**Also known as:** I/O, IO

## Think of it like

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

## 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

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

## 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.

## Why it matters

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

## Common mistake

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

## Three principles

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

## Related terms

- [Program](https://learn.benibix.com/term/development/program)
- [Variable](https://learn.benibix.com/term/development/variable)
- [String](https://learn.benibix.com/term/development/string)
- [Function](https://learn.benibix.com/term/development/function)

## Taught in

- [Programs and Source Code](https://learn.benibix.com/learn/development-concepts/programs-and-source-code): Programming Basics, 1/18

---

Source: https://learn.benibix.com/term/development/input-output
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
