Optimize the following Python program to find the maximum number in a list.
list = [9, 2, 5, 6, 4, 1]
def max_num(list):
  max_num = list[0]

  for num in list:
    if num > max_num:
      max_num = num
  
  return max_num