- Check whether the input is a password or something equally subject to redaction. If so, then use the getpass.getpass() function. This means we need to import the following function:
from getpass import getpass
Otherwise, if the redacted input is not required, use the input() function.
- Determine which prompt will be used. This might be as simple as >>> or something more complex. In some cases, we might provide a great deal of contextual information. In our example, we provided a field name and a hint about the type of data expected as a prompt string. The prompt string is the argument to the input() or getpass() function:
year = int(input("year: "))
- Determine how to validate each item in isolation. The simplest case ...