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