input([prompt])
If [prompt] is present, it is written to the standard output without a line break. The function then reads the input, converts it to a string, and then returns.
1 >>> s = input (") 2 ---Monty Python' s Flying Circus3 >>> s 4"Monty Python ' s Flying Circus"
Add:
Explanation of Python version 2.x:
Input and raw_input can be used to read the console inputs, but input and raw_input are different when working with numbers
When the input is a pure number:
Input returns a numeric type, such as Int,float
Raw_inpout return String type, String type
Input string is an expression
Input computes the numeric expression in the string, and Raw_input does not.
If you enter "57 + 3":
Input will get an integer 60
Raw_input will get the string "57 + 3"
Implementation of Python input
Look at the Python input document, you can see that input is actually implemented through raw_input, the principle is very simple, the following line of code:
1 def input (Prompt): 2 return (eval (raw_input (prompt)))
Python function-input ()