input: Write a function to find the smallest number in a given list. If the list is empty, return None. If the list contains only one element, return that element.
  def smallestNumber(nums):
      if len(nums) == 0:
          return None
      smallest = nums[0]
      for i in range(1, len(nums)):
          if nums[i] < smallest:
              smallest = nums[i]
      return smallest
  
  assert smallestNumber([4, 5, 6, 7, 8]) == 4
  assert smallestNumber([3, 2, 5, 1, 4]) == 1
  assert smallestNumber([9]) == 9
  assert smallestNumber([]) == None
  assert smallestNumber([10, 10, 10, 10]) == 10
output: def smallestNumber(nums):
      if len(nums) == 0:
          return None
      smallest = nums[0]
      for i in range(1, len(nums)):
          if nums[i] < smallest:
              smallest = nums[i]
      return smallest