input: Write a python function to generate a password of a given length, containing letters, digits, and punctuation.
  assert len(generate_password(10)) == 10
  assert len(generate_password(15)) == 15
  assert any(c.isdigit() for c in generate_password(20))
  assert any(c.isalpha() for c in generate_password(20))
  assert any(c in string.punctuation for c in generate_password(20))
output: import string
  import random
  
  def generate_password(length):
      characters = string.ascii_letters + string.digits + string.punctuation
      password = ''.join(random.choice(characters) for _ in range(length))
      return password