input: Write a function to find the maximum number from a given list. If the list is empty, return 0. Otherwise, return the maximum number in the list.
  assert max_num([5, 4, 2, 7, 12]) == 12
  assert max_num([]) == 0
  assert max_num([1, 3, 5, 7, 9]) == 9
  assert max_num([-1, -3, -5, -7, -9]) == -1
  assert max_num([0, 0, 0, 0, 0]) == 0
output: def max_num(lst):
      if not lst:
          return 0
      return max(lst)