Here everyone.
So now we are done with most of the part of our program.
Now the main logic here is left and oh how will I do that one.
Whenever the user will enter any text some word like hey high end these or that are not all of it will
be eliminated.
So program will not focus on them program and just focus on the values that are numeric and the operator
and how heavily defined two functions first that will extracting numbers from the main one.
So whatever this index is.
I will extract the numbers from that one second in which I will use the numbers to make this sum according
to the operator present.
So let me show you how.
First I will define here.
EXTRACT FROM TEXT so x direct underscore from underscore text and provide this one a variable text that
will be the actual syntax and I will provide that one in the second function.
Now here I will take the empty list maybe had the name.
And what will I do for C D in x.
Note split.
So what is actually happening here.
For every t index dot sleep split.
So basically I'm splitting all the numbers so not the numbers.
Every text them and then from that I will just take the numbers and how will I take that one.
I will do something like I will try to convert every text into flow.
And if that is converted that it means that there is a number a device that is a text and how I do that
one.
Like if I just simply write flowed
be here then the cases in which it is actually text it will provide value added like the text is not
converted into floating point values.
So what can I do here is I simply use try and accept.
So it will first try that whether this one is converted into float or not.
If it is converted then what will I do.
I will just append the L so l don't append this particular float value.
So if that is actually like a number three that is converted an appendage into a list and that is if
that is something like three to five.
Then they all will be appended at once.
Then there will be a termination of any X did like and then we go to the second number and after that
one in case the try fails.
That is failed.
Most of the time I would just do accept and their value add so value space.
So in this way it will not provide me any error but for this value add I would just make this one pass
maybe go with that one and then just return
and so then it will be done me the list which contains all the number present.
So I hope you get this wondered how I can extract the numbers from the text.
Just try converting them into float if they're converting append them in list that is an empty list
there first and accept it is a value error then just pass the so David go with that one and after that
one I will define an the function here.
That will simply calculate my values.
So calculate.
I will name dysfunction and no parameters required for that but and in that one what will I do.
I've been forced to take these extra variable that is the text inside the entry descent.
So simply exit in there we go.
And then I will use get method there to get the text and I will do again the same procedure like this
one I dispute the text and check for the opaqueness and I will strive for that one then I have the accept
conditions like here do value add a space to and let's move the data so forth third in X to split the
eagle and pass here.
These dots What will I do there.
I would check for these operators.
So if word and if you remember then here we have taken all these voids like defense at S.F. in uppercase
letters.
So what will I do here.
I would check world above because it might possible use it to enter something like decaf beetle and
all these in smoke.
So I need to convert them all in uppercase letter and that's why I have taken all them in uppercase
so world up balances in.
If that is in this one operation in operation and what I am taking in operation D so don't keys and
I hope you get up to this point at what is actually happening you just take the text then for every
word and text or split I was checked whether daring operation keys or not they're not up.
After that even if there it is then I again have try and accept condition.
So first I wouldn't cry for so eloquent too simply the extract from text.
I will call this one net function and provide that one the text.
And then I will be my output.
And how I would just call the operations here dismount and check whether there's any available there
or not.
So verdant but if it is there or not David will be one and then his boss the first two values of an
so simply I love zero and then I love one name.
So David go with the output and how this one is actually happening.
Let's see this one.
First it will go with the operations it will find which is available there like if there is subtraction
then it will use the value of that one and that particular key.
So this actually is denoting the particular value.
Say this one I get something like sub.
So if there is some ever label them then I have this one simply dispenses and inside them I had this
index values first and second said there are two entry so automatically what's actually happening here.
I'm just calling these mathematical functions so I hope you get that one right now.
And at this point we have these some or whatever we are doing them means actual output.
Now it's just time to make that one in list box.
So list don't delete plus I will make the list empty from 0 2 and David.
So in this way you can make the complete list empty by deleting every value from zero up to end and
then you can simply just insert the value after the end.
Here we have decided to end.
So my next index will be after the end up do so.
So you're not up to date are just inserted there.
So there we go with Declan.
Now I have a except condition the condition in which I use it into something else.
So in that case just us to list or delete from zero to end and then insert please don't insert maybe
go after the N something like say something went wrong go please.
And again there you go.
And finally here I will use a finally an indictment for like big which will help us to provide the after
that one.
I also have a live condition in the condition it feels so device it will show me an ETA word load APO
noting operations noting operations don't cause the condition in which we do not have this one in these
operations.
So here it will do with that condition just same this time.
Come on C and come on.
And there we go with that so here we are done with the complete code and in the next video we will have
a look at this one whether it is working or not and all of its functionality still.
So thanks for watching and I will see in the next video.