How do you accept data in variable from the user? Give Syntax of the command with an example, in python.
Answers
Answered by
6
Answer:
For accepting data from user we use input
Explanation:
For example ,
I need to get an integer from user so the syntax is :
v=int(input("Enter the number"))
Or string :
x=input("Enter the string")
Float:
z=float(input("Enter the float"))
Hope it helps you
Answered by
10
Answer:
We accept data in a variable from the user by the input ( ) function.
This function is used to get data from the user while working with the script mode.
It enables us to accept an input string from the user without evaluating its value.
Syntax: input (<Prompt>)
Similar questions