Professional Documents
Culture Documents
03 Lecture Input From Users
03 Lecture Input From Users
• Using the input() function, users can give any information to the
application in the string format.
In Python 3, we have the input() built-in functions to accept the input
from a user.
input(prompt):
The prompt argument is optional.
The prompt argument is used to display a message to the user.
For example,
input(“Please enter your name”)
When the input() function executes, the program waits until a user
enters some value.
Next, the user enters some value on the screen using a keyboard.
Finally, the input() function reads a value from the screen, converts it
into a string, and returns it to the calling program.
>>> input()
or
is equivalent to