input: Write a function to generate a Random Password of length 8 characters, which contains at least one of each character type (lowercase, uppercase, digits, special characters). If successful, return the generated password.
  assert generate_password()=="aB3!eF7g"
  assert generate_password()=="Xz9@hJ2k"
  assert generate_password()=="qW4$lM8n"
  assert generate_password()=="P5&oR6sT"
  assert generate_password()=="1vY#9bE7"
output: import random
  import string
  
  def generate_password():
      while True:
          password = ''.join(random.choices(string.ascii_letters + string.digits + string.punctuation, k=8))
          if (any(c.islower() for c in password) and
              any(c.isupper() for c in password) and
              any(c.isdigit() for c in password) and
              any(c in string.punctuation for c in password)):
              return password