1 00:00:00,180 --> 00:00:06,740 The interpreter works in two modes one is the interactive mode and the other. 2 00:00:06,780 --> 00:00:10,820 Script mode in the interactive more. 3 00:00:10,860 --> 00:00:15,680 The interpreter gives immediate feedback for each statement. 4 00:00:15,700 --> 00:00:24,530 It also stores the output of previously executed statements in active memory as we enter a new statement 5 00:00:24,590 --> 00:00:27,500 or as a new statement get executed. 6 00:00:27,500 --> 00:00:35,670 The entire sequence of previously executed statement is considered while evaluating the current output. 7 00:00:35,720 --> 00:00:37,610 So what do we mean by this. 8 00:00:37,610 --> 00:00:47,090 Say for example if not i d e v and build the first statement I assign value to to the variable e and 9 00:00:47,090 --> 00:00:48,640 run the interpreter. 10 00:00:48,830 --> 00:00:57,590 The interpreter draws the output of the Executed statement in active memory and then in the second line 11 00:00:58,130 --> 00:01:05,630 I assign the value three to the variable B and then drown the interpreter. 12 00:01:05,630 --> 00:01:19,570 Again next in the third line I give a variable and see which and debatable is a and b and run the interpreter 13 00:01:19,570 --> 00:01:27,470 again now using the print function. 14 00:01:27,510 --> 00:01:31,980 I would like to display the value of the variable C 15 00:01:35,210 --> 00:01:39,550 as new statement that executed by the Python interpreter. 16 00:01:39,590 --> 00:01:51,400 The entire sequence or previously executed statement is considered by evaluating the current output. 17 00:01:53,260 --> 00:02:03,020 And the interactive mode is a good way to play around and try variations on syntax coming to the script 18 00:02:03,230 --> 00:02:04,130 mode. 19 00:02:04,240 --> 00:02:11,720 This script more we give Python of I love Jade Mint and the interpreter interpret all of the statements 20 00:02:11,810 --> 00:02:12,710 in that script. 21 00:02:12,950 --> 00:02:18,370 Interactive mode is great for testing small chunks of code but there is one problem. 22 00:02:18,500 --> 00:02:25,910 These statements you enter into Python no I.D. e are not saved anywhere in case you want to execute 23 00:02:25,910 --> 00:02:29,450 the same set of statements multiple times. 24 00:02:29,450 --> 00:02:33,180 You would be better off to save the entire code in a file. 25 00:02:33,350 --> 00:02:41,370 Then use the Python interpreter and script more to execute the code from a fine now in order to understand 26 00:02:41,400 --> 00:02:46,080 the interactive script mons let's go to the pythons. 27 00:02:46,090 --> 00:02:52,210 Ideally you haven't installed Python or any other I.D. yet. 28 00:02:52,260 --> 00:02:58,050 We will talk about the anacondas Jupiter notebook shortly so do not worry. 29 00:02:58,050 --> 00:03:03,660 But for now let's go to Ida any on the windows system. 30 00:03:03,660 --> 00:03:06,740 Go to the start menu and search for it. 31 00:03:06,790 --> 00:03:17,570 Ideally in case of macros go to the terminal window and then type ideally. 32 00:03:18,020 --> 00:03:22,200 So here is the python so I D E. 33 00:03:23,090 --> 00:03:30,140 The three are all signs that you see here is called the python prompt which means python is ready to 34 00:03:30,140 --> 00:03:36,740 read in a new command by giving us that visual to also. 35 00:03:36,850 --> 00:03:46,900 It's the python way of telling us that we are in the interactive mode so let's print out some text using 36 00:03:46,900 --> 00:03:50,970 the print function say hello world 37 00:03:54,080 --> 00:03:58,760 then hit enter as soon as I hit enter the interpreter. 38 00:03:58,800 --> 00:04:01,790 Execute this particular audio statement. 39 00:04:02,360 --> 00:04:07,280 Now the ideally can also be used as a calculator. 40 00:04:07,340 --> 00:04:11,900 Say for example I want to add the numbers these three numbers. 41 00:04:12,260 --> 00:04:21,370 So the interpreter has added all the three numbers and given as an output immediately. 42 00:04:21,500 --> 00:04:24,490 So this is the interactive mode. 43 00:04:24,580 --> 00:04:29,860 The other mode that we have talked about is the script mode or the normal mode. 44 00:04:29,860 --> 00:04:41,340 And for that you need to put all your statements in a file so then go to the fight and then see you 45 00:04:41,350 --> 00:04:44,400 fight and you. 46 00:04:44,450 --> 00:04:47,090 I'm willing to give a print function 47 00:04:50,190 --> 00:04:53,940 and put in scrap more. 48 00:04:54,710 --> 00:05:04,030 Multiply two numbers 20 multiplied by seven then do a division 34. 49 00:05:04,030 --> 00:05:16,300 Divide by nine of them and we will save this by to save your playing mode. 50 00:05:16,340 --> 00:05:19,200 This code text Daud. 51 00:05:19,440 --> 00:05:30,560 B Why is the extension C now in order to execute this fine at the top. 52 00:05:30,640 --> 00:05:38,070 Choose the run and go to run module I have three statements in. 53 00:05:38,090 --> 00:05:41,490 Define these are the three statements. 54 00:05:41,690 --> 00:05:50,530 I have three statements in the file that I see but I only see the first statement has been output by 55 00:05:50,530 --> 00:06:00,100 the interpreter in the script more that because in the script more in order to display any text or any 56 00:06:00,100 --> 00:06:05,440 statement or expression any value in the script mode. 57 00:06:05,500 --> 00:06:15,110 If you want to display something we need to use the print function this is not required in case or for 58 00:06:15,200 --> 00:06:17,750 the python's interactive mode. 59 00:06:18,200 --> 00:06:29,060 So now let's go to the same light and use the print function to do the math calculations and you need 60 00:06:29,060 --> 00:06:33,600 to see your filing in and then execute 61 00:06:36,260 --> 00:06:37,010 now. 62 00:06:37,010 --> 00:06:40,550 Now you have all of the statements in the file executed. 63 00:06:41,510 --> 00:06:48,730 So this is about to the into the interpreters mode interactive and script more.