How to use 'how to print second largest number in python' in Python

Every line of 'how to print second largest number in python' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
9def largestnumber(lst):
10 answer = []
11
12 while lst!=[]:
13 max_digit = 0
14 for digit in lst:
15 if IsGreaterOrEqual(digit, max_digit):
16 max_digit = digit
17 answer.append(max_digit)
18 lst.remove(max_digit)
19
20 return answer

Related snippets