input: Write a function to generate a random password with a minimum length of 8 characters, including at least one number and one special character. 
  assert generate_password()!=None
  assert len(generate_password())>=8
  assert any(char.isdigit() for char in generate_password())
  assert any(char in string.punctuation for char in generate_password())
  assert generate_password()!=generate_password()
  assert generate_password()!=generate_password()
  assert generate_password()!=generate_password()
output: import random
  import string
  
  def generate_password():
      length = random.randint(8, 12)
      chars = string.ascii_letters + string.digits + string.punctuation
      password = ''.join(random.choice(chars) for _ in range(length))
      while not (any(char.isdigit() for char in password) and any(char in string.punctuation for char in password)):
          password = ''.join(random.choice(chars) for _ in range(length))
      return password