Taking input in Python:
Developers often 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.
input ( ) : This function first takes the input from the user and then evaluates the expression, which means Python automatically identifies whether the user has entered a string or a number or list. If the input provided is not correct then either a syntax error or an exception is raised by python.
How the input function works in Python :
When input() function gets executed, the program flow will be stopped until the user has given an input.
The text or message displays on the output screen to ask a user to enter an input value.
Example: In this example, we’ll use both input and print function.
Try this out :
name = input(“What is your name: “)
print(name)
Output: the output should display your name on the terminal.
Congrats! You now know how to use the input function.
If you don’t have python installed in your device, use the link below ππ»
https://www.programiz.com/python-programming/online-compiler/
If you want to learn about the print function in this code, click the button below.