input: Write a function to find the smallest number in a given list. The function should return the smallest number found in the 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([3, 0, -1, 2])==-1
  assert smallestNumber([10])==10
  assert smallestNumber([])==None
  assert smallestNumber([1, 2, 3, -4, 5])==-4
output: def smallestNumber(nums):
      if not nums:
          return None
      smallest = nums[0]
      for num in nums[1:]:
          if num < smallest:
              smallest = num
      return smallest