input: Write a function to print the following output pattern for a given input integer n. The function should print the numbers from 1 to i for each row i from 1 to n, each number separated by a space and each row should end with a new line.
  assert print_pattern(5)==None
  for i in range(1,6):
      for j in range(1,i+1):
          print(j, end=" ")
      print()
  assert print_pattern(3)==None
  for i in range(1,4):
      for j in range(1,i+1):
          print(j, end=" ")
      print()
output: def print_pattern(n):
      for i in range(1, n + 1):
          for j in range(1, i + 1):
              print(j, end=" ")
          print()