1 00:00:05,760 --> 00:00:07,010 Here everyone. 2 00:00:07,080 --> 00:00:09,770 So now we are done with most of the part of our program. 3 00:00:09,780 --> 00:00:13,500 Now the main logic here is left and oh how will I do that one. 4 00:00:13,650 --> 00:00:20,550 Whenever the user will enter any text some word like hey high end these or that are not all of it will 5 00:00:20,550 --> 00:00:21,840 be eliminated. 6 00:00:21,840 --> 00:00:27,870 So program will not focus on them program and just focus on the values that are numeric and the operator 7 00:00:28,290 --> 00:00:35,070 and how heavily defined two functions first that will extracting numbers from the main one. 8 00:00:35,400 --> 00:00:36,910 So whatever this index is. 9 00:00:36,910 --> 00:00:44,610 I will extract the numbers from that one second in which I will use the numbers to make this sum according 10 00:00:45,090 --> 00:00:46,410 to the operator present. 11 00:00:47,100 --> 00:00:48,830 So let me show you how. 12 00:00:48,900 --> 00:00:50,590 First I will define here. 13 00:00:50,700 --> 00:01:03,720 EXTRACT FROM TEXT so x direct underscore from underscore text and provide this one a variable text that 14 00:01:03,720 --> 00:01:09,210 will be the actual syntax and I will provide that one in the second function. 15 00:01:09,210 --> 00:01:15,680 Now here I will take the empty list maybe had the name. 16 00:01:16,340 --> 00:01:22,050 And what will I do for C D in x. 17 00:01:22,050 --> 00:01:25,720 Note split. 18 00:01:26,000 --> 00:01:27,920 So what is actually happening here. 19 00:01:28,400 --> 00:01:32,080 For every t index dot sleep split. 20 00:01:32,090 --> 00:01:36,050 So basically I'm splitting all the numbers so not the numbers. 21 00:01:36,230 --> 00:01:44,050 Every text them and then from that I will just take the numbers and how will I take that one. 22 00:01:44,120 --> 00:01:47,440 I will do something like I will try to convert every text into flow. 23 00:01:48,200 --> 00:01:55,400 And if that is converted that it means that there is a number a device that is a text and how I do that 24 00:01:55,400 --> 00:01:55,960 one. 25 00:01:56,120 --> 00:01:58,460 Like if I just simply write flowed 26 00:02:01,390 --> 00:02:08,470 be here then the cases in which it is actually text it will provide value added like the text is not 27 00:02:08,470 --> 00:02:11,740 converted into floating point values. 28 00:02:11,830 --> 00:02:17,620 So what can I do here is I simply use try and accept. 29 00:02:19,000 --> 00:02:24,470 So it will first try that whether this one is converted into float or not. 30 00:02:24,580 --> 00:02:27,110 If it is converted then what will I do. 31 00:02:27,130 --> 00:02:34,950 I will just append the L so l don't append this particular float value. 32 00:02:35,500 --> 00:02:41,470 So if that is actually like a number three that is converted an appendage into a list and that is if 33 00:02:41,470 --> 00:02:43,170 that is something like three to five. 34 00:02:43,990 --> 00:02:46,110 Then they all will be appended at once. 35 00:02:46,150 --> 00:02:54,130 Then there will be a termination of any X did like and then we go to the second number and after that 36 00:02:54,130 --> 00:02:57,340 one in case the try fails. 37 00:02:57,340 --> 00:02:57,830 That is failed. 38 00:02:57,850 --> 00:03:08,410 Most of the time I would just do accept and their value add so value space. 39 00:03:09,920 --> 00:03:16,550 So in this way it will not provide me any error but for this value add I would just make this one pass 40 00:03:18,020 --> 00:03:20,570 maybe go with that one and then just return 41 00:03:23,520 --> 00:03:29,690 and so then it will be done me the list which contains all the number present. 42 00:03:29,690 --> 00:03:34,910 So I hope you get this wondered how I can extract the numbers from the text. 43 00:03:34,910 --> 00:03:40,640 Just try converting them into float if they're converting append them in list that is an empty list 44 00:03:40,640 --> 00:03:49,100 there first and accept it is a value error then just pass the so David go with that one and after that 45 00:03:49,100 --> 00:03:51,200 one I will define an the function here. 46 00:03:53,560 --> 00:03:56,170 That will simply calculate my values. 47 00:03:56,170 --> 00:03:57,250 So calculate. 48 00:03:57,820 --> 00:04:04,890 I will name dysfunction and no parameters required for that but and in that one what will I do. 49 00:04:04,920 --> 00:04:12,270 I've been forced to take these extra variable that is the text inside the entry descent. 50 00:04:12,770 --> 00:04:17,180 So simply exit in there we go. 51 00:04:17,180 --> 00:04:23,030 And then I will use get method there to get the text and I will do again the same procedure like this 52 00:04:23,030 --> 00:04:30,300 one I dispute the text and check for the opaqueness and I will strive for that one then I have the accept 53 00:04:30,310 --> 00:04:43,460 conditions like here do value add a space to and let's move the data so forth third in X to split the 54 00:04:43,730 --> 00:04:45,890 eagle and pass here. 55 00:04:46,030 --> 00:04:49,890 These dots What will I do there. 56 00:04:50,490 --> 00:04:52,750 I would check for these operators. 57 00:04:52,920 --> 00:05:02,760 So if word and if you remember then here we have taken all these voids like defense at S.F. in uppercase 58 00:05:02,760 --> 00:05:03,850 letters. 59 00:05:03,930 --> 00:05:04,980 So what will I do here. 60 00:05:05,190 --> 00:05:10,650 I would check world above because it might possible use it to enter something like decaf beetle and 61 00:05:10,680 --> 00:05:11,510 all these in smoke. 62 00:05:12,150 --> 00:05:16,890 So I need to convert them all in uppercase letter and that's why I have taken all them in uppercase 63 00:05:17,760 --> 00:05:22,480 so world up balances in. 64 00:05:22,920 --> 00:05:37,030 If that is in this one operation in operation and what I am taking in operation D so don't keys and 65 00:05:37,060 --> 00:05:43,680 I hope you get up to this point at what is actually happening you just take the text then for every 66 00:05:43,690 --> 00:05:50,420 word and text or split I was checked whether daring operation keys or not they're not up. 67 00:05:51,190 --> 00:05:56,550 After that even if there it is then I again have try and accept condition. 68 00:05:56,980 --> 00:06:03,960 So first I wouldn't cry for so eloquent too simply the extract from text. 69 00:06:03,980 --> 00:06:09,070 I will call this one net function and provide that one the text. 70 00:06:10,550 --> 00:06:12,890 And then I will be my output. 71 00:06:13,310 --> 00:06:20,210 And how I would just call the operations here dismount and check whether there's any available there 72 00:06:20,270 --> 00:06:20,730 or not. 73 00:06:21,170 --> 00:06:31,770 So verdant but if it is there or not David will be one and then his boss the first two values of an 74 00:06:33,230 --> 00:06:41,390 so simply I love zero and then I love one name. 75 00:06:42,900 --> 00:06:48,420 So David go with the output and how this one is actually happening. 76 00:06:48,630 --> 00:06:49,660 Let's see this one. 77 00:06:49,710 --> 00:06:56,160 First it will go with the operations it will find which is available there like if there is subtraction 78 00:06:56,940 --> 00:07:01,050 then it will use the value of that one and that particular key. 79 00:07:01,530 --> 00:07:05,770 So this actually is denoting the particular value. 80 00:07:05,770 --> 00:07:09,400 Say this one I get something like sub. 81 00:07:09,420 --> 00:07:17,550 So if there is some ever label them then I have this one simply dispenses and inside them I had this 82 00:07:17,640 --> 00:07:24,990 index values first and second said there are two entry so automatically what's actually happening here. 83 00:07:24,990 --> 00:07:31,710 I'm just calling these mathematical functions so I hope you get that one right now. 84 00:07:31,710 --> 00:07:38,530 And at this point we have these some or whatever we are doing them means actual output. 85 00:07:38,580 --> 00:07:42,520 Now it's just time to make that one in list box. 86 00:07:42,520 --> 00:07:49,350 So list don't delete plus I will make the list empty from 0 2 and David. 87 00:07:49,810 --> 00:07:55,870 So in this way you can make the complete list empty by deleting every value from zero up to end and 88 00:07:55,870 --> 00:08:00,920 then you can simply just insert the value after the end. 89 00:08:01,000 --> 00:08:03,590 Here we have decided to end. 90 00:08:03,670 --> 00:08:08,220 So my next index will be after the end up do so. 91 00:08:08,320 --> 00:08:12,810 So you're not up to date are just inserted there. 92 00:08:13,630 --> 00:08:15,310 So there we go with Declan. 93 00:08:16,030 --> 00:08:22,240 Now I have a except condition the condition in which I use it into something else. 94 00:08:22,240 --> 00:08:33,500 So in that case just us to list or delete from zero to end and then insert please don't insert maybe 95 00:08:33,610 --> 00:08:45,220 go after the N something like say something went wrong go please. 96 00:08:45,220 --> 00:08:49,180 And again there you go. 97 00:08:49,380 --> 00:08:57,890 And finally here I will use a finally an indictment for like big which will help us to provide the after 98 00:08:57,890 --> 00:08:58,340 that one. 99 00:08:58,610 --> 00:09:07,550 I also have a live condition in the condition it feels so device it will show me an ETA word load APO 100 00:09:10,010 --> 00:09:20,580 noting operations noting operations don't cause the condition in which we do not have this one in these 101 00:09:20,580 --> 00:09:21,830 operations. 102 00:09:21,990 --> 00:09:26,880 So here it will do with that condition just same this time. 103 00:09:26,960 --> 00:09:29,080 Come on C and come on. 104 00:09:29,870 --> 00:09:37,880 And there we go with that so here we are done with the complete code and in the next video we will have 105 00:09:37,880 --> 00:09:44,510 a look at this one whether it is working or not and all of its functionality still. 106 00:09:44,570 --> 00:09:46,700 So thanks for watching and I will see in the next video.