r/PythonLearning • u/RegularBother614 • 15d ago
What do you guys think?
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
View all comments
Show parent comment
7
u/mossse 15d ago
That wouldn't keep it intact because
sortmodifies the list. You shared another solution usingsorted, which doesn't have this side effect.