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()!=generate_password()
  assert all(char in string.digits + string.punctuation for char in generate_password() if len(generate_password())==8)
output: import random
  import string
  
  def generate_password():
      min_length = 8
      password = []
      password.append(random.choice(string.digits))
      password.append(random.choice(string.punctuation))
      password.extend(random.choices(string.ascii_letters + string.digits + string.punctuation, k=min_length-2))
      random.shuffle(password)
      return ''.join(password)