Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
find the second maximum in python
0
votes
asked
Jun 1, 2019
by
PERUMALLA PRIYANKA ECE DEPT
(
120
points)
Please
log in
or register to answer this question.
2 Answers
0
votes
answered
Jun 3, 2019
by
sowmiya E
L=[1,2,3,4,5,6,7,8]
max=L[0];
max2=L[0];
for i in L:
m=i;
if(m>max):
max2=max;
max=m;
else if(m>max2):
max2=m;
else:
continue;
Please
log in
or register to add a comment.
+1
vote
answered
Jun 7, 2019
by
SatyoJena
(
200
points)
a list is given. say. l
there is a function sort(). used as
l.sort()
then,the list will be sorted in increasing order.
then find the second element from last i.e.
l[-2].
commented
Jun 9, 2019
by
bhanu
(
100
points)
how i will be incremented
Please
log in
or register to add a comment.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...