input: Write a Python function to generate the given pattern of asterisks and hash marks. 
  assert pattern(3) == '''*
  **
  ***
  '''
  assert pattern(4) == '''*
  **
  ***
  ****
  '''
  assert pattern(5) == '''*
  **
  ***
  ****
  *****
  '''
output: def pattern(n):
      result = ''
      for i in range(1, n + 1):
          result += '*' * i + '\n'
      return result