6
User Inputs and Outputs
The key purpose of software is to produce useful output. One simple type of output is text displaying some useful result. Python supports this with the print() function.
The input() function has a parallel with the print() function. The input() function reads text from a console, allowing us to provide data to our programs.
There are a number of other common ways to provide input to a program. Parsing the command line is helpful for many applications. We sometimes need to use configuration files to provide useful input. Data files and network connections are yet more ways to provide input. Each of these methods is distinct and needs to be looked at separately. In this chapter, we'll focus on the fundamentals of input() ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access