input: Write a function to generate a random password of length 8 characters that contains at least one lowercase letter, one uppercase letter, one digit, and one special character. The generated password should be printed as output.
  
  assert generate_password()
  assert len(generate_password())==8
output: import random
  import string
  
  def generate_password():
      lowercase = random.choice(string.ascii_lowercase)
      uppercase = random.choice(string.ascii_uppercase)
      digit = random.choice(string.digits)
      special_char = random.choice(string.punctuation)
      remaining = ''.join(random.choices(string.ascii_letters + string.digits + string.punctuation, k=4))
      password = lowercase + uppercase + digit + special_char + remaining
      password_list = list(password)
      random.shuffle(password_list)
      password = ''.join(password_list)
      return password