Skip to content

Instantly share code, notes, and snippets.

@nitesh8860
Created June 12, 2020 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nitesh8860/6d46566f9500bcb8033885f84682b00c to your computer and use it in GitHub Desktop.
Save nitesh8860/6d46566f9500bcb8033885f84682b00c to your computer and use it in GitHub Desktop.
getting the second highest number in the list with help of filter in python
max_arr=max(arr)
arr=list(filter(lambda x: x!=max_arr, arr))
print(max(arr))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment