The input()
function in Python is used to allow a user to enter input data into the program. Once the statement containing the input function is encountered, the program pauses to wait for the user to enter something.
input(prompt)
copy
Where the prompt is an optional statement or query for the user that will appear on the screen.
We can assign the value entered by the user to a variable, this value is always received as a string but we can cast it to other type if necessary.