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. Return the generated password.
  assert generate_password()=="Ab#12d!R"
  assert generate_password()=="Z@9fP4wQ"
  assert generate_password()=="7*LpT3vB"
  assert generate_password()=="X&5gY2mN"
  assert generate_password()=="6$UjW8zK"
output: import random
  import string
  
  def generate_password():
      characters = string.ascii_letters + string.digits + string.punctuation
      while True:
          password = ''.join(random.choice(characters) for i in range(8))
          if any(c.isdigit() for c in password) and any(c in string.punctuation for c in password):
              return password