WEBVTT

00:01.390 --> 00:04.320
Variables are often described as boxes.

00:04.330 --> 00:07.030
You can store values in it.

00:08.440 --> 00:15.160
This idea can be helpful in the first few times you use a variable, but it isn't an accurate way to

00:15.160 --> 00:19.780
describe how variables are represented internally in Python.

00:19.930 --> 00:23.710
It's a much better to think of a variable as labels.

00:24.070 --> 00:28.120
You can assign values on them.

00:29.310 --> 00:34.080
You can also say that the variable references a certain value like this.

00:35.570 --> 00:42.050
So this things distinction probably won't matter much in your initial programs, but it's worth learning

00:42.050 --> 00:43.990
earlier rather than later.

00:44.000 --> 00:51.080
At some point you will see unexpected behavior from a variable and an accurate understanding of how

00:51.080 --> 00:56.630
variables work will help you identify what's happening in your code.

01:00.350 --> 01:06.840
Because most programs define and gather some sort of data and then do something useful with it.

01:06.860 --> 01:10.190
It helps to classify different types of data.

01:10.220 --> 01:14.810
The first data type, we will look at the string.

01:14.840 --> 01:22.820
Strings are quite simple at first glance, but you can use them in many different ways.

01:23.150 --> 01:25.400
A string is a series of characters.

01:25.430 --> 01:28.160
Anything inside quote is considered.

01:28.160 --> 01:30.470
For example, this is a string.

01:34.060 --> 01:43.750
So yeah, there's also you can write a string like this, for example, my special message.

01:43.990 --> 01:48.100
And here we will add single quote instead of double quote.

01:48.310 --> 01:51.040
Hello, my name is Stephan.

01:52.070 --> 01:58.100
And the flexibility allows you to use quotes and apostrophes within your strings.

01:59.160 --> 02:02.120
So let's write actual text here.

02:02.130 --> 02:02.790
Mice.

02:03.480 --> 02:05.040
My here.

02:12.610 --> 02:14.500
My another.

02:15.230 --> 02:16.880
Super string.

02:16.910 --> 02:20.500
And here we will do a sample.

02:20.510 --> 02:24.220
One of Python's strings.

02:25.470 --> 02:32.460
Is it's it's diverse and supportive community.

02:34.140 --> 02:34.830
That's it.

02:35.040 --> 02:37.980
Now, let's explore here.

02:37.980 --> 02:38.970
As you can see here, there's.

02:40.210 --> 02:42.730
Strings at this lecture.

02:42.760 --> 02:45.970
Now let's explore some of the ways you can use strings.

02:46.000 --> 02:51.370
The first is changing case in a string with methods.

02:51.370 --> 02:55.120
So I think we can now delete this here for now.

02:56.180 --> 02:58.130
And let's get more practical.

02:58.130 --> 02:58.610
All right?

02:59.590 --> 03:00.190
That's it.

03:01.010 --> 03:08.810
So here, one of the simplest tasks you can do with strings is change the case of the words in a string.

03:09.260 --> 03:11.560
So let's look at this code here.

03:11.570 --> 03:16.310
For example, my name is, for example, Oxley.

03:16.310 --> 03:17.720
Or actually, let's make it.

03:19.300 --> 03:22.930
Academy name is.

03:24.740 --> 03:25.730
Academy name.

03:27.520 --> 03:27.910
Here.

03:27.940 --> 03:29.230
This is a name.

03:29.590 --> 03:33.100
And here, Oxley Academy.

03:33.340 --> 03:40.660
And here we will print name that title of academy name that here.

03:40.660 --> 03:43.470
As you can see, we have several formats we use actually several.

03:43.510 --> 03:48.970
It's it's a lot of formats and functions, but you will learn all of these functions.

03:49.120 --> 03:50.500
Don't worry here.

03:50.500 --> 03:52.210
Now we will use title.

03:52.450 --> 03:53.410
That's it.

03:53.500 --> 03:56.380
Now let's actually run this code.

03:57.010 --> 03:59.050
And as you can see here.

03:59.830 --> 04:09.940
In this example, the variable academy name, the variable academy name refers to the lower case Oxilia

04:09.940 --> 04:10.590
Academy.

04:10.600 --> 04:13.300
See here lower case lowercase.

04:14.290 --> 04:16.120
The method title.

04:17.250 --> 04:21.500
Appears after the variable in the print.

04:21.510 --> 04:22.320
Right.

04:22.560 --> 04:27.150
So a method is an action that python can perform.

04:27.150 --> 04:30.720
One a piece of data.

04:30.810 --> 04:32.130
The dot here.

04:32.160 --> 04:33.270
The dot here.

04:34.690 --> 04:37.990
After name in the academic title.

04:39.160 --> 04:45.160
Cast fight on to make the title method act on a variable name.

04:45.340 --> 04:46.340
So that's it.

04:46.360 --> 04:49.420
Every method is followed by a set of parentheses, right?

04:49.540 --> 04:56.080
So because methods often need additional information to do their work, that information is provided

04:56.080 --> 04:58.030
inside the parentheses.

04:58.240 --> 05:03.890
So the title function doesn't need any additional information, so its parentheses are empty.

05:03.910 --> 05:09.080
So here let's as you can see, there's no additional information we can provide to title.

05:11.070 --> 05:14.410
So title method changes.

05:15.940 --> 05:25.040
Each word to title case where each word begins with capital letter oxa.

05:26.220 --> 05:27.240
Oxley.

05:29.350 --> 05:31.150
And here Capital letter A.

05:33.270 --> 05:34.080
Academy.

05:41.070 --> 05:41.880
That's it.

05:42.930 --> 05:48.360
So this is useful because you will often want to think of a name as a piece of information.

05:48.360 --> 05:54.090
For example, you might want your program to recognize the input value values.

05:54.090 --> 05:55.410
Auxly.

05:56.540 --> 06:05.660
Academy as the same name and display all of them as uppercase Oxley and then lowercase the title format.

06:05.660 --> 06:06.020
Right?

06:06.020 --> 06:12.890
So several other useful format methods are available for dealing with case as well.

06:12.890 --> 06:22.220
For example, you can change a string to all uppercase or all lowercase letters like this here.

06:22.220 --> 06:27.080
So here we will write instead of title, we will delete this and upper.

06:27.110 --> 06:28.100
That's it.

06:28.100 --> 06:29.060
Let's try this.

06:29.060 --> 06:31.070
And as you can see, uppercase.

06:31.080 --> 06:33.590
Let's actually delete this here.

06:34.400 --> 06:37.070
That's the output of us here.

06:37.100 --> 06:37.430
Oops.

06:37.430 --> 06:37.970
Sorry.

06:39.360 --> 06:39.840
Here.

06:40.320 --> 06:42.840
As you can see, an uppercase Lochside academy.

06:42.870 --> 06:48.090
Let's try the lowercase lower.

06:50.700 --> 06:53.850
As you can see here, lowercase Oxford Academy.

06:54.120 --> 06:57.640
So the lower method is particularly useful for storing data.

06:57.690 --> 07:02.010
So you typically want to want to trust the capitalization that your users provide.

07:02.010 --> 07:03.120
So will you.

07:03.150 --> 07:13.290
So you will convert strings to lowercase, will convert your strings to lowercase before storing them.

07:13.290 --> 07:19.140
Then you when you want to display the information, you will use the case that makes the most sense

07:19.140 --> 07:21.480
for each string.
