Python: Take User Input

Most programs today use a dialog box as a way of asking the user to provide some type of input. While Python provides us with inbuilt functions to read the input from the keyboard.

We can take user input using input () method. It first takes the input from the user and then evaluates the expression, which means Python automatically identifies whether user entered a string or a number or list. If the given input  is not correct then either syntax error or exception is raised by python.

Example:

name = input("Enter Name:")
print("Name is: " + name)

Output:

Enter Name: Python
Name is: Python
Tags