r/PythonLearning • • 17d ago

What do you guys think?

Post image

I made a program that finds the second largest digit in a list.

Using the list method "remove()" and "max" function. Python is COOL!

88 Upvotes

58 comments sorted by

View all comments

Show parent comment

1

u/NoMakeSenseOk 16d ago

I'm indeed not a dev, no. Still learning.

2

u/Strong_Essay1176 16d ago

Just do a,b=numbers[0],numbers]0] In loop set max to a and prev max to b.

Any kind sort - is like rebuilding whole building just to open 2 doors.