input: Write a function to find the smallest number in a given list. If the list is empty, the function should 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([10, 8, 3, 15, 6])==3
  assert smallestNumber([7])==7
  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