Summary
In this chapter, we discussed input and output in Python algorithms. Input is how we get information for the algorithm to respond to. For example, a user can provide input to an algorithm that has prompts for that information, as we saw in the sample problems. Python and other programming languages can also get input from a mouse, scanners, cameras, and other devices that the program interacts with.
In order to write our algorithms, it is important to identify what inputs we need, when we need them in the design, and what we need as output from the program. In Chapter 3, Understanding Algorithms and Algorithmic Thinking, we used user input to find the cost of lunches. We had created a dictionary to help us find that information. Similarly, after reading this chapter, you now have the skills required to build algorithms to solve some additional problems, such as our digit guessing game and our maximum finder.
Identifying input and output is critical before we design algorithms...