input: Write a python function to generate a password of specified length containing letters, digits, and punctuation.
  assert len(generate_password(10)) == 10
  assert len(generate_password(15)) == 15
  assert isinstance(generate_password(8), str)
output: import random
  import string
  
  def generate_password(length):
      if length < 1:
          return ''
      
      characters = string.ascii_letters + string.digits + string.punctuation
      password = ''.join(random.choice(characters) for _ in range(length))
      
      return password