input: from typing import List
  
  def max_num(nums: List[int]) -> int:
      """ Find the maximum number in the given list of integers.
      >>> max_num([9, 2, 5, 6, 4, 1])
      9
      >>> max_num([-1, -5, -3, -2, -4])
      -1
      """
output:     if not nums:
          return None
      max_val = nums[0]
      for num in nums:
          if num > max_val:
              max_val = num
      return max_val