input: Write a function to find the second smallest number in a list.
  assert second_smallest([1, 2, -8, -2, 0, -2])==-2
  assert second_smallest([1, 1, -0.5, 0, 2, -2, -2])==-0.5
  assert second_smallest([2,2])==None
  
output: def second_smallest(lst):
      if len(lst) < 2:
          return None
      smallest = second = float('inf')
      for num in lst:
          if num < smallest:
              second = smallest
              smallest = num
          elif num < second and num != smallest:
              second = num
      return second if second != float('inf') else None