input: def generate_password() -> str:
      """Generate a random password of length 8, which consists of alphanumeric characters and at least one special character.
      >>> generate_password()
      'aB3$dF7!'
      >>> generate_password()
      '2@Ez8jKq'
      """
output:     import random
      import string
  
      characters = string.ascii_letters + string.digits + string.punctuation
      password = ''.join(random.choice(characters) for _ in range(7))
      password += random.choice(string.punctuation)
      return ''.join(random.sample(password, len(password)))