r/PythonLearning • • 15d 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

7

u/mossse 15d ago

That wouldn't keep it intact because sort modifies the list. You shared another solution using sorted, which doesn't have this side effect.

1

u/NoMakeSenseOk 15d ago

Oh, thanks for the correction! I still got lots to learn as an intermediate.