Console input/output means that we input using the keyboard, and the output will be shown on the screen.

Receive input from the console

Console input can be received using the built-in input() function.

The general form of the input() function is:

s = input('prompt')

The 'prompt' is a string displayed on the screen, soliciting a value. The input() function returns a string. If 123 is entered as input, '123' is returned.

Receive multiple values

The input() function can be used to receive one or more values.

Get hands-on with 1400+ tech skills courses.