input: Write a function to generate and print a Pascal triangle for a given number of rows. The function should print each row of the Pascal triangle properly formatted. 
  
  def PascalTriangle(n):
      arr = [0 for i in range(n)]
      for line in range(0, n):
          for i in range(0, line + 1):
              if i == 0 or i == line:
                  arr[i] = 1
              else:
                  arr[i] = arr[i] + arr[i - 1]
          for i in range(0, line + 1):
              print(arr[i], end=" ")
          print()
  
  assert PascalTriangle(5)
  assert PascalTriangle(3)
  assert PascalTriangle(1)
  assert PascalTriangle(0)
output: def PascalTriangle(n):
      for line in range(n):
          arr = [1] * (line + 1)
          for i in range(1, line):
              arr[i] = arr[i-1] * (line - i + 1) // i
          print(" ".join(map(str, arr)))