input: from typing import List
  
  def smallestNumber(nums: List[int]) -> int:
      """ Find the smallest number in a given list.
      >>> smallestNumber([4, 5, 6, 7, 8])
      4
      >>> smallestNumber([8, 3, 9, 2, 1])
      1
      """
output:     if not nums:
          return None
      min_num = nums[0]
      for num in nums:
          if num < min_num:
              min_num = num
      return min_num