Programming Languages
Python
Subjective
Sep 30, 2025
Write a Python function to find the second largest number in a list.
Detailed Explanation
def second_largest(lst):\n unique_nums = list(set(lst))\n if len(unique_nums) < 2:\n return None\n unique_nums.sort()\n return unique_nums[-2]
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts