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)
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
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;
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
+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
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...