input: Write a python function to find the second largest number in a list.
  assert second_largest([10, 3, 5, 22, 4]) == 10
  assert second_largest([1, 2, 3, 4, 5]) == 4
  assert second_largest([5, 5, 5, 4]) == 4
  assert second_largest([5, 1, 5, 1, 5]) == 1
  assert second_largest([1, 1, 1, 1]) == float("-inf")
output: def second_largest(nums):
      first = second = float('-inf')
      for num in nums:
          if num > first:
              first, second = num, first
          elif first > num > second:
              second = num
      return second