Now, let's solve the next question.
This is a slightly difficult in nature, so we will be tackling more difficult questions over the time.
So please don't get intimidated.
We will solve these step by step.
Just try to solve these questions.
I do it all.
And in case you find any difficulty, you can go ahead and look at the solutions.
So let's look at the first question.
So given the names and grades for each student in a class of in students, store them in a nested list
and print the names of any student having the second lowest grade.
So if there are multiple students with the second lowest grade, ordered the names alphabetically and
print each name on a new line.
So basically, we will be having any students who let's get the means of end student and then try to
find out the student who is having bluescreen.
So you can pause the video here and then solve the question and you can have a look at the solution.
One step.
So now let's start solving this problem.
So first, we will need to have the number of students in the class, so let's get the number of students
in the class in.
And because it is a numbers, so it has to be in danger.
So we say in and then we take the input and inside the input.
Let us ask a question that please provide the number of students.
Next, we need to create a list, a nested list of the marks of the servants.
So let's get the same.
So let's keep stude marks.
So we'll take the input
of
the names.
And next, we will take the score of the student.
School can be affluent.
So we will save it as a float.
Now we want to get this, we want to save this for an
invention
and.
So let's run with this for once.
So let's take two.
So the A's and the school is 23.
Let it be.
And the school is 12 to see and this gorgeous.
Eighty seven.
So you can see we are saving it in the Néstor list.
Now, what we want to achieve it is we want to check for each and every student.
And we want to get the name of the student with the mark.
The marks which they have got is the second lowest.
OK.
So for this, we will need to get all the marks for the student.
Then we will basically find out the second lowest mark out of this.
So how can we do that?
So let's get the marks for NEMCO marks and stroma.
So here we have all the marks for the students.
Now, then we worry.
Then we are using six.
We will be getting one of each of the values.
Now we want to convert this into a list.
So we say list.
And for there, we want to sort this list.
So we have selected.
Let's see what we get.
So we get this sorted list.
Now, I want to get the second element.
That is the second last element.
So I want indexed one.
So I see one here.
So this is it.
Now, this is the mark which I want.
So I want to call them this from these two.
I want to be meem with my mark is equal to this.
So what do we see?
We'll see.
Give me the name for me.
Go mama
in.
Is.
Time to do this.
Let's run this.
So I get a logistic got counter.
If I would have not given this condition,
then I would have got all the names on one side, give this particular condition, I can get the one
which has the second right now in case.
Why have we used that here?
Because there could be multiple students who can have the second lowest grade.
So when we have this, what will happen is that it will automatically return all the elements where
math will be equal to this particular value.
So if there are one student with the second lowest mark, over one hundred students, if rules are done,
all of them.