Taking input in python
Developers often have a need to interact with users, either to get data or to provide some sort of result. 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 two inbuilt functions to read the input from the keyboard.
- input ( prompt )
- raw_input ( prompt )
input ( ) : This function 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 input provided is not correct then either syntax error or exception is raised by python. For example –
filter_none
edit
play_arrow
brightness_4
# Python program showing
# a use of input()
val =
input("Enter your value: ")
print(val)