In this lesson, I'm going to show you how you can ask the user to write something,
which you can then use and store inside a variable.
This will add more interactiveness to the program and makes it more dynamic.
It's going to be great for your Python learning path.
So if you want to ask the user to write something,
you just have to use the input function like this.
Open and close the parentheses.
So I press enter and now as you can see the cursor is on the next line
and is actually waiting for you to write something.
So let's write test.
Okay and you can see now the result.
So what is going into the input function is test.
Input.
If you want, you can also ask the user.
So you can ask a question.
If you just write input, it's going to wait for an input.
You can also give an information of what you want.
Let's say choose a number.
So now I have choose a number and I can choose a number.
Let's say 3.
I write 3 and then it is evaluated to 3.
So we can actually make it better.
Just put a column like this in a space.
Okay to make it look better.
And as you can see here, if you give a string or if you give a number,
the result is always going to be a string with the input function.
Okay if I type input.
Let's say choose a number.
So here as you can see I'm using a Python function inside another Python function.
In that case what is going to happen, the more
nested function is actually going to be called first.
So input is going to be called so it will print choose a number.
And then this, the result of the input function is going to go in the type function
which will evaluate the type of what you gave.
So I'm going to put 3 and you can see now we have type string.
Okay that's an important thing to know is that whenever you use input,
the result you are going to get will be of type string.
And well what you can do is, I can do, so let's do input.
And I can do for example a is equal to input.
Okay so I choose a number let's say 67.
And now the result of the input will go to the variable a.
So if I do a, I get 67 which is of course a string here.
But then from that you can use the input of the user in your program.