input: Write a python function to generate a random password of a given length containing letters, digits, and punctuation.
  assert len(generate_password(8)) == 8
  assert len(generate_password(12)) == 12
  assert any(c in string.ascii_letters for c in generate_password(10))
  assert any(c in string.digits for c in generate_password(10))
  assert any(c in string.punctuation for c in generate_password(10))
output: import random
  import string
  
  def generate_password(length):
      if length < 1:
          raise ValueError("Password length must be at least 1")
      
      all_chars = string.ascii_letters + string.digits + string.punctuation
      password = ''.join(random.choice(all_chars) for _ in range(length))
      
      return password