Input input function for python input and output

 

Note: raw_input: there is no raw_input after python3.0

Python provides the input() function to read a line of text from standard input. The default standard input is the keyboard.

input can receive a Python expression as input and return the result of the operation.

#!/usr/bin/python3

str = input("Please enter:");

print ("What you entered is: ", str)

 

1. Function format

input([prompt])

2. Function

Accept a standard input data, return as string type, prompt as prompt message. ctrl+Z end input

3. Common parameters

slightly

4. Command examples:

Default input(): Wait for the input of an arbitrary character

strText = input("Input a string: \n"): Accept input data as string type and pass it to strText, \n is the prompt message to wrap.

 

Guess you like

Origin blog.csdn.net/helunqu2017/article/details/114557475