input: Write a function to generate a random password of length 8, ensuring it contains at least one lowercase letter, one uppercase letter, and one digit.
  assert len(generate_password()) == 8
  assert any(char.islower() for char in generate_password())
  assert any(char.isupper() for char in generate_password())
  assert any(char.isdigit() for char in generate_password())
output: import random
  import string
  
  def generate_password():
      lower = random.choice(string.ascii_lowercase)
      upper = random.choice(string.ascii_uppercase)
      digit = random.choice(string.digits)
      all_chars = string.ascii_letters + string.digits
      password = lower + upper + digit + ''.join(random.choice(all_chars) for _ in range(5))
      password_list = list(password)
      random.shuffle(password_list)
      return ''.join(password_list)