Programs communicate with users through input and output operations. Output (e.g., print) sends text or values to the console; input (e.g., input() or scanf) reads text typed by the user. All console input arrives as text (strings), so numeric input must be converted to the appropriate type before arithmetic. Clear, informative output is a form of program documentation for the user.
Write interactive programs that prompt for input, compute something, and display results. Deliberately forget type conversion and observe the resulting error.
You already know how to store data in variables and work with different data types. Input and output (I/O) are how your program communicates with the outside world — specifically, how it displays results to the user and receives data from them. Without I/O, a program computes in silence: it might calculate the answer to a problem, but no one would ever see it.
Output is the simpler side. In Python, `print()` sends text to the console. In C, `printf()` does the same. You can output literal strings (`print("Hello")`), variable values (`print(x)`), or combinations using string formatting or concatenation. The key idea is that output converts your program's internal data into a human-readable text representation. When you print an integer, the language converts the binary number in memory into a sequence of digit characters on screen. This conversion happens automatically for basic types, but understanding that it occurs helps you troubleshoot when output looks unexpected.
Input is where most beginners encounter their first surprising bug. When a user types `42` at the keyboard, the program receives the *string* `"42"` — two characters, not a number. This is because the console deals exclusively in text. If you want to do arithmetic with that value, you must explicitly convert it: `int("42")` in Python, `atoi()` or `scanf("%d", ...)` in C. Forgetting this conversion is the single most common I/O mistake. Your program will either crash with a type error or silently produce wrong results by concatenating strings instead of adding numbers. The rule is simple: all console input arrives as text, and you are responsible for parsing it into the type you need.
Good I/O also means writing clear prompts that tell the user what to type. A prompt like `"Enter your age: "` (with a trailing space) is far better than a blank cursor that leaves the user guessing. Think of output as your program's voice and input as its ears — together they create the conversation between human and machine. As you progress, you will learn to read from files and network connections, but the console I/O patterns you build now — prompt, read, convert, compute, display — are the foundation for all interactive programming.