input: from typing import List
  
  def generate_password(length: int = 8) -> str:
      """Generate a random password of a specified length, including at least one special character.
      >>> generate_password(8)
      'aB3$d9@x'
      >>> generate_password(10)
      'X6#y2P$q8Z'
      """
      import string
      import random
  
      chars = string.ascii_letters + string.digits + string.punctuation
      password = ''
      for i in range(length):
          password += random.choice(chars)
      
      if any([char in string.punctuation for char in password]):
          return password
      else:
          return generate_password(length)
output:     import string
      import random
  
      chars = string.ascii_letters + string.digits + string.punctuation
      password = ''
      for i in range(length):
          password += random.choice(chars)
      
      if any([char in string.punctuation for char in password]):
          return password
      else:
          return generate_password(length)