input: from typing import List
  
  def generate_password() -> str:
      """ Generate a random password with a minimum length of 8 characters, 
      containing at least one number and one special character.
      >>> generate_password()
      'A1!defgh'
      >>> generate_password()
      'B2@ijklm'
      """
output:     import random
      import string
  
      length = random.randint(8, 12)
      characters = string.ascii_letters + string.digits + string.punctuation
      password = [random.choice(string.ascii_letters)]
  
      while len(password) < length:
          char = random.choice(characters)
          if char in string.digits and not any(c.isdigit() for c in password):
              password.append(char)
          elif char in string.punctuation and not any(c in string.punctuation for c in password):
              password.append(char)
          elif char not in string.digits and char not in string.punctuation:
              password.append(char)
  
      return ''.join(password)