WEBVTT

00:00.120 --> 00:01.040
Welcome back.

00:01.280 --> 00:05.840
Now let's move to the next lesson which is getting input from the user.

00:05.880 --> 00:12.440
We use the input function to ask the user for information for example username.

00:12.840 --> 00:16.680
This is the variable equals to input function.

00:16.680 --> 00:18.680
What is your name.

00:18.800 --> 00:19.760
Let me run.

00:19.920 --> 00:26.480
And here we get an input box and waiting for the input from the user.

00:26.480 --> 00:29.680
Let me name it as John.

00:29.720 --> 00:30.600
Hit enter.

00:30.760 --> 00:33.600
The second line will be executed.

00:33.640 --> 00:36.840
Hello John, welcome to Python.

00:36.880 --> 00:45.240
Here we are using the formatted string and we're going and we used the username variable.

00:45.280 --> 00:54.640
We get the value from the user from the input from the user and place it in our hello statement.

00:54.760 --> 01:00.720
So again hello we get the username value from the user.

01:00.720 --> 01:04.640
And we continue with Welcome to Python.

01:04.800 --> 01:13.130
The input function always returns a string to use numbers, convert them for example.

01:13.170 --> 01:14.210
Birth year.

01:14.250 --> 01:14.770
Input.

01:14.770 --> 01:16.250
Enter your birth year.

01:16.370 --> 01:17.490
For example.

01:17.690 --> 01:20.770
Uh one 1992.

01:20.890 --> 01:21.530
Enter.

01:21.770 --> 01:24.570
You are 33 years old.

01:24.770 --> 01:27.610
This returns a string.

01:27.890 --> 01:32.930
Age equals to 2025 minus int.

01:32.930 --> 01:39.370
I'm converting this string into integer using this int function.

01:39.610 --> 01:48.370
This int function converts a number or string to an integer or return zero if no arguments are given.

01:48.530 --> 01:57.810
Okay, so this returns transform and convert the birth year, which is a string into integer.

01:58.010 --> 02:03.970
Because we need to to, uh, make this subtraction from an integer.

02:04.210 --> 02:12.570
Also, we used the formatted string and we replaced the age with its actual value.

02:12.610 --> 02:13.450
Okay guys.

02:13.650 --> 02:19.530
So this is how we use the input and get the input from the user.
