Python input() function

The input() function in Python reads a line from input and converts it to a string (stripping a trailing newline).

Syntax

Parameter

prompt: This function represents a string, depicting a default message before the input.

Return

This function returns the string value if theĀ promptĀ argument is present and it is written to standard output without a trailing newline.

Example 1

Output

Pin It on Pinterest

Share This