input: Write a python function to generate a random password of specified length that contains at least one special character and one numeric character.
  assert len(generate_password(8)) == 8
  assert any(char.isdigit() for char in generate_password(8))
  assert any(char in string.punctuation for char in generate_password(8))
  assert len(generate_password(12)) == 12
output: import random
  import string
  
  def generate_password(length):
      if length < 2:
          raise ValueError("Password length must be at least 2 to include one special character and one numeric character")
          
      all_chars = string.ascii_letters + string.digits + string.punctuation
      password = [
          random.choice(string.digits),
          random.choice(string.punctuation)
      ]
      
      password += random.choices(all_chars, k=length-2)
      random.shuffle(password)
      
      return ''.join(password)