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.
  assert generate_password()=="A1!defgh"
  assert generate_password()=="B2@ijkl"
  assert generate_password()=="C3#mnop"
  assert generate_password()=="D4$qrst"
  assert generate_password()=="E5%uvwx"
output: import random
  import string
  
  def generate_password():
      chars = string.ascii_letters + string.digits + string.punctuation
      while True:
          password = ''.join(random.choice(chars) for _ in range(8))
          if any(c.isdigit() for c in password) and any(c in string.punctuation for c in password):
              return password