Home>Article>Backend Development> Detailed introduction to Python’s built-in input function

Detailed introduction to Python’s built-in input function

高洛峰
高洛峰 Original
2017-03-21 10:36:06 3646browse

English documentation:

input([prompt])

Ifthepromptargument is present, it is written to standard output without a trailingnewline. The function then reads a line from input, converts it to astring(stripping a trailing newline), andreturns that. When EOF is read,EOFErroris raised

Instructions:

 1. If the promat parameter is provided, the parameter value is first output to the standard output, and No line breaks.FunctionReads the value entered by the user and converts it into astring.

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

The above is the detailed content of Detailed introduction to Python’s built-in input function. For more information, please follow other related articles on the PHP Chinese website!

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