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 the length of the password is less than 8, return an empty string. Return the generated password.
  assert generate_password()=="Password is: " and len(generate_password())==8
output: import random
  import string
  
  def generate_password():
      if len(generate_password()) < 8:
          return ""
      characters = string.ascii_lowercase + string.ascii_uppercase + string.digits + string.punctuation
      password = [
          random.choice(string.ascii_lowercase),
          random.choice(string.ascii_uppercase),
          random.choice(string.digits),
          random.choice(string.punctuation)
      ]
      password += random.choices(characters, k=4)
      random.shuffle(password)
      return ''.join(password)