WEBVTT 00:01.120 --> 00:06.940 In this section we will learn what our variables and how to declare them as variables belongs to a certain 00:06.940 --> 00:07.660 type. 00:07.660 --> 00:14.970 We will also be looking at numbers string and boolean types variables are references to a space in memory. 00:14.970 --> 00:21.630 These references are associated with an arbitrary name we use variables to hold values and operate with 00:21.630 --> 00:22.610 them. 00:22.650 --> 00:24.360 There's two ways to define variables. 00:24.450 --> 00:26.610 On the first one we do like this. 00:26.610 --> 00:35.040 Var h in this means var indicates the final declaration. 00:36.420 --> 00:45.790 Age is the name we assign to that variable which presumably means that we're going to store some H and 00:45.790 --> 00:50.590 Third the type and refers to integer. 00:50.770 --> 00:53.650 So what we're doing here is what we're saying. 00:54.830 --> 00:59.720 We want to declare a very local age which is going to be storing integral values. 00:59.750 --> 01:03.680 The second way to do it is a much shorter version of the same. 01:04.280 --> 01:12.110 And you have to write it like this age Col on equal as a number let's say 0 because we're initializing 01:12.110 --> 01:16.520 the variables so the compiler will say 0 is a number. 01:16.910 --> 01:19.770 So it should be the same type as before which is. 01:19.770 --> 01:23.080 And now we have many types. 01:23.330 --> 01:29.290 The core language define three main types numbers strings and boolean. 01:29.500 --> 01:31.110 So we have different types of numbers. 01:31.120 --> 01:37.890 We have integral numbers which are the natural numbers from 0 2 very big number. 01:37.900 --> 01:41.500 We also have floats which is numbers with decimals. 01:41.500 --> 01:43.060 Let's define an integer. 01:43.120 --> 01:45.090 You will do it like this right. 01:45.220 --> 01:47.430 X column equals 10. 01:47.470 --> 01:50.990 If we want to define float number we will do it like this. 01:51.100 --> 01:51.990 Why. 01:52.010 --> 01:55.360 Colon equals five point three. 01:55.360 --> 01:59.170 Even if those variables looks pretty similar they are not. 01:59.320 --> 02:10.410 So if I want to add x plus y we have invalid operation because the ties are different so it can be added 02:10.410 --> 02:11.580 with a float. 02:11.580 --> 02:21.750 Something very important to note here is that values can change X can be 10 and then I can do X equals 02:21.750 --> 02:22.880 2. 02:22.990 --> 02:25.950 Well both types count. 02:25.950 --> 02:29.730 Another type is string which we saw in the previous section. 02:30.180 --> 02:35.180 So if I want to name equals to John. 02:35.670 --> 02:37.730 Name will be of type String. 02:37.770 --> 02:42.900 This is the same as doing var Name Type stream. 02:43.410 --> 02:45.400 Equals to John. 02:45.630 --> 02:53.610 A difference between these two notation is that these can be defined at the package level which is outside 02:54.060 --> 03:01.890 any function and these notation with the call on equal can just be defined inside functions. 03:01.930 --> 03:09.590 The last time I want to show you is the boolean type which can have just two values true or false. 03:09.820 --> 03:13.880 So let's say I want to define a boolean variable. 03:13.900 --> 03:17.220 I will do var v bool. 03:17.440 --> 03:23.020 We're gonna go into more detail with this type and the control structure sections. 03:23.050 --> 03:26.420 So regarding variable that's all. 03:26.470 --> 03:30.010 Remember there's two ways to write it down. 03:30.010 --> 03:37.660 Long version and the short version and they are pretty useful for passing values to defined functions 03:38.020 --> 03:41.080 functions is going to be explained next chapters.