© Paul Gerrard 2016
Paul GerrardLean Python10.1007/978-1-4842-2385-7_4

4. Input and Output

Paul Gerrard
(1)
Maidenhead, Berkshire, UK
 
If a program did not produce any output, it wouldn’t be very useful, would it? If a program did not accept some data that varied from time to time, it would produce the same result again and again and again, and that wouldn’t be very useful either (after its first run at least). Most programs, therefore, need to accept some inputs or input data, so that they can product output data, outputs, or results.
In this chapter, we cover three important input/output mechanisms:
  • Displayed output.
  • Getting data from the user through the keyboard.
  • Getting input from and writing output to disk files.

Displaying Output

You’ve seen the ...

Get Lean Python: Learn Just Enough Python to Build Useful Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.