1 of 5
Exercise #1beginner

Find the Second Largest Number

Given a list of numbers nums = [12, 45, 2, 45, 19, 31, 8], find and print the second largest unique number in the list.

Instructions

  • Remove duplicates by converting `nums` to a `set`.
  • Sort the unique values.
  • Print the second largest element.
Progressive Hints (1 / 2)

Use `sorted(list(set(nums)))` to get sorted unique elements in ascending order.

solution.py
Loading Monaco Editor...

Press Ctrl+Enter or click "Run Code" to execute your solution in the browser.