Home >Backend Development >Python Tutorial >Python built-in function input

Python built-in function input

高洛峰
高洛峰Original
2016-11-02 14:11:461544browse

English documentation:

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

Explanation:

  1. If the promat parameter is provided, the parameter value is first output to the standard output without line breaks. The function reads the value entered by the user and converts it into a string.

>>> s = input('please input your name:')
please input your name:Ain>>> s'Ain'


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn