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