input: Write a python function to generate a random string of given length.
  ```python
  import random
  import string
  
  def generate_random_string(n):
      characters = string.ascii_letters + string.digits + string.punctuation
      result = ''.join(random.choice(characters) for _ in range(n))
      return result
  
  # Test cases
  assert len(generate_random_string(5)) == 5
  assert len(generate_random_string(10)) == 10
  assert len(generate_random_string(15)) == 15
output: def generate_random_string(n):
      characters = string.ascii_letters + string.digits + string.punctuation
      result = ''.join(random.choice(characters) for _ in range(n))
      return result