A very big one.
Welcome back.
In the previous lecture, we learned about aggregate functions, and in this lecture we are going to
learn about analytical functions.
We are going to learn about four amazing analytical functions in Python.
Eval Lenn factorial assort, so let us get started with the eval function.
The email function evaluates the string like a python expression and returns the result as an integer.
Eval function is mostly used in situations where we need to evaluate mathematical expressions, let
us look at an example and try evaluating a mathematical expression.
Suppose we have an expression as X to the power two plus two, X minus two.
We use eval function to solve this mathematical expression.
Using X is equal to three eval X to the power two plus two, X minus two.
This results in 13.
Next, we have the land function, the land function returns, the number of items in an object.
Let us try understanding this with the help of an example.
We define a list called numbers, which is equal to four seventy six to thirty four, one two nine.
Len, numbers would return the number of items present in the list, this returns six.
Next, we have the factorial function.
The factorial function in the math module helps us to compute the factorial of a number without writing
the whole code.
For accessing the factorial function, we import the Mac module.
Import math, and now we can compute the factorial of any number.
Matt don't factorial five, so this results in 120.
Map Dot Factorial nine.
This results in three six two eight eight zero.
Next, we have the thought function.
The search function, sort of the elements of an object in a specified ascending or descending order.
Let us look at an example.
Suppose we have a list called Runs, which contains the information of runs made by a cricket player
in his last seven matches.
Now we want to sort the runs made by him in the descending order.
Runs is equal to forty five, ten one fifty seventy six, twenty eight, ninety two hundred.
Runs don't sort drivers is equal to true, this results.
Two hundred 150, ninety seventy six.
Forty five.
Twenty eight, 10.
If reverse is equal to falls, the list would be sorted in ascending order.
And here we come to the end of the section where we learned about aggregate and analytical functions.
In the next section, we are going to learn about recursion so that in your function.