input: Write a function to find the smallest number in a given list. If the list is empty then return None.
  def smallestNumber(nums):
      if not nums:
          return None
      smallest = nums[0]
      for num in nums:
          if num < smallest:
              smallest = num
      return smallest
  
  assert smallestNumber([4, 5, 6, 7, 8]) == 4
  assert smallestNumber([9, 3, 7, 1, 5]) == 1
  assert smallestNumber([1, 1, 1, 1, 1]) == 1
  assert smallestNumber([-1, -5, -3, -2, -4]) == -5
  assert smallestNumber([]) == None
output: def smallestNumber(nums):
      if not nums:
          return None
      smallest = nums[0]
      for num in nums:
          if num < smallest:
              smallest = num
      return smallest