1 00:00:11,200 --> 00:00:13,110 Guys will come back in this to do. 2 00:00:13,360 --> 00:00:17,340 We are going to learn about why he was so variables. 3 00:00:17,610 --> 00:00:24,840 The fundamental concept in almost every programming language, and they are used in almost every programming 4 00:00:24,840 --> 00:00:25,680 language as well. 5 00:00:26,280 --> 00:00:28,680 So what is the definition of a variable? 6 00:00:30,060 --> 00:00:37,020 So the simple definition of a variable can be container's used to store data. 7 00:00:38,160 --> 00:00:44,760 So variables are just containers used to store data values in a remote location. 8 00:00:44,760 --> 00:00:53,670 So get the best metaphor for this can be 10 variables like a box Nymagee and the value is data stored 9 00:00:53,670 --> 00:00:54,450 in that box. 10 00:00:55,290 --> 00:00:57,960 And these data values can be of any day today. 11 00:00:58,890 --> 00:01:01,290 We are going to see that in the next tutorials. 12 00:01:01,650 --> 00:01:08,580 But right now, just remember that variables are used to store data, at least in remote locations. 13 00:01:08,610 --> 00:01:13,350 OK, so how can we declare the variables in Python? 14 00:01:14,550 --> 00:01:20,460 So the thing is, we don't need to declare the variables or initialize the variables in Python. 15 00:01:20,970 --> 00:01:24,690 We just need to name the variable and assign them to look at that variable. 16 00:01:25,230 --> 00:01:32,280 And not declaring and not initializing variables means we don't need any keywords to include the variables 17 00:01:32,280 --> 00:01:32,760 in Python. 18 00:01:32,760 --> 00:01:39,000 OK, like in other languages, we need some sort of some sort of keywords, particularly the variables 19 00:01:39,510 --> 00:01:40,650 like in JavaScript. 20 00:01:40,650 --> 00:01:44,100 We need wildly to continue to duplicate the variable. 21 00:01:44,550 --> 00:01:47,520 But in Python we don't need such cures. 22 00:01:47,760 --> 00:01:50,190 We just need to give a name to the variable. 23 00:01:50,730 --> 00:01:52,830 And then I say, know how to do that. 24 00:01:53,940 --> 00:01:56,100 Now we are going to see how to do that. 25 00:01:56,440 --> 00:02:04,560 Now, here is a variable student and we are going to assign the value to this variable now. 26 00:02:04,560 --> 00:02:06,310 But I say no value to the variable. 27 00:02:06,900 --> 00:02:12,240 This equals sign or the whole assignment operator is used in Python. 28 00:02:12,240 --> 00:02:18,310 OK, so it's operator and then the value, let's say, values there. 29 00:02:19,110 --> 00:02:20,340 So this is a value. 30 00:02:22,080 --> 00:02:27,240 So this is a declaration of of variables in Python. 31 00:02:29,190 --> 00:02:31,530 Now, what will happen when we run this program? 32 00:02:32,100 --> 00:02:38,650 Python interpreter will look at some memory space to store this value in that memory space. 33 00:02:38,670 --> 00:02:49,770 OK, and then you would have this variable student will just act like a label to this very same label 34 00:02:49,770 --> 00:02:51,120 or placeholder to this value. 35 00:02:51,570 --> 00:02:56,500 OK, and we can use this variable anywhere in our program. 36 00:02:56,820 --> 00:03:01,770 This doesn't really work anywhere in our program to get access to this value sample. 37 00:03:01,830 --> 00:03:05,410 OK, and now we are able to get all this variable. 38 00:03:06,120 --> 00:03:14,200 So to get the output, we use the print function in part, OK, print function is used in by the. 39 00:03:16,080 --> 00:03:26,220 So to get output of this variable print and then variable, which is a student student and we don't 40 00:03:26,220 --> 00:03:31,620 have to use quotes here because it's not a string, it is a variable look. 41 00:03:32,580 --> 00:03:40,410 So print student and then if we run this we will get output in the terminal. 42 00:03:40,440 --> 00:03:43,810 OK, so it is all put in the. 43 00:03:45,220 --> 00:03:49,190 Now, let's do this variable studen to different value. 44 00:03:49,240 --> 00:04:00,640 OK, so student and let's say June and if so, what what do you think will be the output of this program? 45 00:04:01,450 --> 00:04:04,770 Is it going to be the same or is it going to be this June? 46 00:04:05,440 --> 00:04:06,450 So let's see. 47 00:04:07,960 --> 00:04:09,910 So June will be printed in the journal. 48 00:04:09,940 --> 00:04:10,720 So why? 49 00:04:11,200 --> 00:04:15,630 Because the Python interpreter executed the code line by line. 50 00:04:16,000 --> 00:04:22,770 So this student, this variable, this value will be updated in this very well. 51 00:04:22,780 --> 00:04:23,100 Okay. 52 00:04:24,110 --> 00:04:32,200 Well, if again, change this value to something else, update this variable to John List here, John. 53 00:04:33,450 --> 00:04:39,460 And if I bring this again, John will continue to remember this python interpreter. 54 00:04:39,540 --> 00:04:43,570 We're always going to print the last object to the value of the variable. 55 00:04:43,720 --> 00:04:49,090 Now, what if I change the value of this student variable to something else? 56 00:04:49,510 --> 00:04:50,770 Something like a number. 57 00:04:51,220 --> 00:04:54,820 So let's change this value to ten. 58 00:04:55,630 --> 00:05:04,510 OK, now what we did here is we changed the date to table this variable from string to a number. 59 00:05:05,050 --> 00:05:13,300 And we can do this in Python code because Python is a dynamically typed language and in dynamically 60 00:05:13,300 --> 00:05:19,030 typed languages, dated out of the variables or does not match. 61 00:05:19,060 --> 00:05:20,170 Read the declaration. 62 00:05:20,240 --> 00:05:28,840 OK, now let's talk about assigning values to the variables so you can assign multiple value values 63 00:05:29,470 --> 00:05:30,850 to the multiple variables. 64 00:05:31,570 --> 00:05:36,160 Let's see how well we have student student. 65 00:05:36,180 --> 00:05:40,710 So basically these three years have same name, right. 66 00:05:40,930 --> 00:05:44,340 Same variable, but they have different values. 67 00:05:44,350 --> 00:05:44,680 Right. 68 00:05:44,710 --> 00:05:47,170 So it will always we are already seeing that. 69 00:05:48,050 --> 00:05:54,140 What an interpreter who is going to print the last a little word to me in good order to print it last. 70 00:05:54,640 --> 00:05:58,230 They lose the last value, John, to do with that. 71 00:05:59,440 --> 00:06:11,620 So now if I change this to the, say, two and three and now if I bring this to this, print it to do 72 00:06:11,650 --> 00:06:11,910 it. 73 00:06:11,950 --> 00:06:13,150 So here we go again. 74 00:06:13,210 --> 00:06:16,330 OK, so these three are different variables and different values. 75 00:06:16,360 --> 00:06:24,310 Right now, there is also another way to articulate this way, to assign these variables and acquis. 76 00:06:24,700 --> 00:06:28,960 And just you can assign these variables to the values in just one level. 77 00:06:28,990 --> 00:06:33,680 OK, so we can also assign these variables into just one line. 78 00:06:33,750 --> 00:06:37,540 OK, this there is another way that I'm going to show you now. 79 00:06:39,160 --> 00:06:39,880 Student. 80 00:06:40,930 --> 00:06:48,070 One variable that is your first variable then student to the second variable, and there's two and three 81 00:06:49,090 --> 00:06:52,930 now here you can see we had three variables separate to do. 82 00:06:52,930 --> 00:06:57,280 The second one separated these three variables. 83 00:06:57,310 --> 00:07:04,380 Now I'm able to assign similar values to these variables and the values are also separated into commas. 84 00:07:04,390 --> 00:07:21,340 OK, so Jane and then John, so what we did here, we just this is another way to I to the variables. 85 00:07:21,340 --> 00:07:29,230 OK, this you can assign multiple variables to the multiple values in one scenario to this. 86 00:07:29,230 --> 00:07:37,690 And if I want to do this, well, again, I just have to bring this student to the the value of this, 87 00:07:37,900 --> 00:07:38,290 Jane. 88 00:07:38,610 --> 00:07:44,240 OK, so here you can see here it will be generally printed in the terminal. 89 00:07:44,830 --> 00:07:49,480 So, again, if I want to get the value, let's do it. 90 00:07:49,990 --> 00:07:55,430 You know, and if I want to get all these three values, then I would print all these three variables. 91 00:07:55,450 --> 00:07:57,730 OK, so student one. 92 00:07:58,360 --> 00:07:59,230 Student two. 93 00:07:59,230 --> 00:08:00,970 And then I'm going to print this. 94 00:08:02,920 --> 00:08:04,020 STUDENT three. 95 00:08:06,710 --> 00:08:08,020 If they sell. 96 00:08:09,940 --> 00:08:15,040 So I will get all this through, will you, Sam, John and John, so you can get a particular value 97 00:08:15,040 --> 00:08:17,200 or all of these values quantize.