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

86 Upvotes

58 comments sorted by

View all comments

Show parent comment

0

u/sexiestsaxiestman 11d ago

Haha, no problem. Basically n is the number of elements in your list in this case. Time complexity is related to how many operations the solution requires. Something like max(list) would be O(n) since it has to check every element in the list once (n operations).