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
8
u/princepii 15d ago
quick note:
that method functions if no doubles or more are in that list.
further remove() changes the list inplace. that effect is called inplace-mutation thru runtime you have removed objects inside your original list.
always try to be not restructive. only if you don't need stuff anymore thru runtime you can consider removing em.
but for 1 hour learning. it's good thought process:)