WEBVTT

00:00.570 --> 00:06.090
In this section, you will learn about the different kinds of data you can work with in your Python

00:06.090 --> 00:06.770
programs.

00:06.780 --> 00:11.100
You will also learn how to use variables to represent data in your programs.

00:11.100 --> 00:13.410
So here we will.

00:15.320 --> 00:18.150
Write a simple code here, which is Hello world.

00:18.310 --> 00:19.010
Print.

00:19.900 --> 00:23.140
Hello, Oxley World.

00:23.620 --> 00:31.570
And here, let's take a closer look at what Python does when you run this script.

00:31.810 --> 00:37.990
As it turns out, Python does a fair amount of work even within the runs a simple program.

00:37.990 --> 00:41.770
So when you run this code, you should see this output.

00:41.770 --> 00:51.100
So when you run the our main.py file, the ending page here indicates that the file is a python program

00:51.100 --> 00:57.880
and your editor runs the file through the python interpreter which reads through the program and determines

00:57.880 --> 01:01.570
that what each word in the program means.

01:01.570 --> 01:10.180
For example, when the interpreter sees the word print here, when the interpreter sees the word print,

01:10.360 --> 01:12.280
followed by parentheses here.

01:13.250 --> 01:18.470
It prints to the screen whatever is inside the parentheses here.

01:19.980 --> 01:25.770
As you write your programs, your editor highlights different parts of your program in different ways.

01:25.800 --> 01:33.990
For example, it recognizes the print is the name of a function like this here and displays the word

01:33.990 --> 01:36.150
in one color.

01:36.180 --> 01:42.660
It recognizes that Hello world is not a python code here.

01:45.080 --> 01:49.370
And this place that fairs in different color.

01:49.820 --> 01:52.370
As you can see, it's green, it's purple here.

01:52.370 --> 01:59.510
So the feature is called syntax highlighting, and it's quite useful as you start to write your own

01:59.510 --> 02:00.500
programs.

02:03.410 --> 02:04.970
So let's get started with variables.

02:04.970 --> 02:10.790
So let's try using a variable in our main file and let's add a new line here.

02:10.790 --> 02:13.790
So we will message and here.

02:14.120 --> 02:17.630
Hello world.

02:19.090 --> 02:19.570
Here.

02:19.810 --> 02:23.500
And after that we will use print again.

02:23.530 --> 02:24.280
Print?

02:24.310 --> 02:25.750
Maybe if I raise them.

02:29.140 --> 02:30.010
Font size a little bit.

02:30.010 --> 02:32.350
So you can see better here.

02:32.830 --> 02:33.760
25.

02:35.050 --> 02:36.250
Okay, Nice.

02:36.580 --> 02:39.490
So now we're going to use print message.

02:40.470 --> 02:44.810
So now let's run this program again and see what's happening here.

02:44.820 --> 02:47.310
As you can see here, Hello world again.

02:47.700 --> 02:51.270
So we have added a variable name.

02:52.860 --> 02:58.140
And name the message, and every variable is connected to a value.

02:59.710 --> 03:03.580
Which is the information associated with that variable.

03:04.410 --> 03:07.860
In this case, the value is Hello World.

03:08.540 --> 03:09.500
This is the text.

03:10.210 --> 03:17.650
And adding a variable makes it a little more work for Python interpreter and when it processes the first

03:17.650 --> 03:25.420
line, it associates the variable message with the Hello World text.

03:25.420 --> 03:32.140
And when it reaches the second line, it prints the value associated with the message to the screen.

03:33.870 --> 03:39.910
Now let's expand on this program by modifying this file to print a second message.

03:39.930 --> 03:47.790
Here we will add a blank line to here and then we will add two new lines to the code.

03:48.210 --> 03:51.990
Now, message and here, Oxley.

03:53.180 --> 03:54.080
Python.

03:54.900 --> 03:55.710
Training.

03:56.440 --> 03:58.360
And or course.

03:58.360 --> 03:58.990
Right.

03:59.770 --> 04:03.250
And here after that, we will also print this message.

04:03.250 --> 04:06.280
So remember, these are the same variable names here.

04:06.670 --> 04:12.700
So now when you run this code, you will see this message.

04:13.660 --> 04:20.920
But you can change the value of variable in your program at any time, and Python will always keep track

04:20.920 --> 04:23.260
of its current value.
