input()

input([prompt])

If the prompt argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that. When EOF is read, EOFError is raised. Example:

1
2
3
4
>>> s = input('--> '
--> Monty Python's Flying Circus
>>> s 
"Monty Python's Flying Circus"

If the readline module was loaded, then input() will use it to provide elaborate line editing and history features.

doc_python
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.