when we talk about data that is stored in a variable, you have the option to take data from the user.
input() function is used to take user input. In other words, in the program's running state, users can write the data.
SYNTAX:
var_name=input("message")
example:
email=input("enter any email")
print("you entered ",email)
passowrd=input("enter your password")
print("you entered ",password)
note: when taking data from the user, you will get the data of string type.
example:
data=input("enter any value")
print(type(data))
output:
<class 'str'>
HOW INPUT FUNCTION WORKS?
input function holds the program until the user does,t press enter.
after pressing enter, the typed data will be stored in a variable (if a variable is used).
0 Comments