input: Write a function to generate the following output pattern: for each number i from 1 to 5, print numbers from 1 to i, each number separated by a space. If the input is not between 1 and 5, return an empty string.
  def print_output_pattern(n):
      if n < 1 or n > 5:
          return ""
      for i in range(1, n + 1):
          for j in range(1, i + 1):
              print(j, end=" ")
          print()
  
  assert print_output_pattern(3)==None
  assert print_output_pattern(0)==""
  assert print_output_pattern(7)==""
output: def print_output_pattern(n):
      if n < 1 or n > 5:
          return ""
      result = ""
      for i in range(1, n + 1):
          for j in range(1, i + 1):
              result += str(j) + " "
          result = result.strip() + "\n"
      return result.strip()