User Inputs
Info:
To get input from user, you use the input()
function.
For example:
value = input('Enter a value:')
print(value)
The output of this code will be :
Enter a value:
However you should remember that the input()
function returns a string and NOT and integer.
You can put that to a variable as well and it will ask for a user input and assign it to a variable. For example:
price = input('Enter the price ($):')
And this will output as:
Enter the price ($):