input: Write a function to print out Pascal's triangle for a given number of rows. The function should take an integer n as input and print the n rows of Pascal's triangle. If n is less than 1, the function should not print anything.
  assert pascal_triangle(5)
  assert pascal_triangle(0)==None
  assert pascal_triangle(1)
  assert pascal_triangle(3)
  assert pascal_triangle(10)
output: def pascal_triangle(n):
      if n < 1:
          return
      for i in range(n):
          row = [1] * (i + 1)
          for j in range(1, i):
              row[j] = prev_row[j - 1] + prev_row[j]
          prev_row = row
          print(' '.join(map(str, row)).center(n * 3))