input: Write a python function to generate a password with given length, number of lowercase letters, uppercase letters, and special characters.
  assert len(generate_password(8, 1, 1, 1)) == 8
  assert sum(c.islower() for c in generate_password(8, 2, 2, 2)) == 2
  assert sum(c.isupper() for c in generate_password(8, 2, 2, 2)) == 2
  assert sum(c in '!@#$%^&*()' for c in generate_password(8, 2, 2, 2)) == 2
output: import random
  import string
  
  def generate_password(length, num_lowercase, num_uppercase, num_special):
      if num_lowercase + num_uppercase + num_special > length:
          raise ValueError("Total number of specified characters exceeds the password length")
  
      lowercase_letters = random.choices(string.ascii_lowercase, k=num_lowercase)
      uppercase_letters = random.choices(string.ascii_uppercase, k=num_uppercase)
      special_characters = random.choices('!@#$%^&*()', k=num_special)
      
      remaining_length = length - num_lowercase + num_uppercase + num_special
      remaining_characters = random.choices(string.ascii_letters + string.digits + '!@#$%^&*()', k=remaining_length)
      
      password_list = lowercase_letters + uppercase_letters + special_characters + remaining_characters
      random.shuffle(password_list)
      
      return ''.join(password_list)