We use the input()
function in python to obtain the user input. The name of the input()
function itself means that it allows the user to give input.
input(prompt)
prompt
: A string representing a message before the input.
print('Enter your Country:')x = input()print(x)
Enter the input below
input()
function to get user input. The input is stored in a variable x
. The variable x
is then printed in line 3 to show the input.x = input("Please enter your name: ")print("Hello, " + x )print(" Welcome to Educative.")
Enter the input below
input()
function along with the prompt
parameter.