input: Write a function to generate a random password with a minimum length of 8 characters, containing at least one number and one special character. The function should take no input and return the generated password as a string.
  assert generate_password() != generate_password()
  assert len(generate_password()) >= 8
  assert any(char in string.digits for char in generate_password())
  assert any(char in string.punctuation for char in generate_password())
output: import random
  import string
  
  def generate_password():
      min_length = 8
      all_chars = string.ascii_letters + string.digits + string.punctuation
      password = ''.join(random.choice(all_chars) for _ in range(min_length))
      while not (any(char in string.digits for char in password) and any(char in string.punctuation for char in password)):
          password = ''.join(random.choice(all_chars) for _ in range(min_length))
      return password