input: Write a function to generate a random password of given length containing lowercase, uppercase letters, and digits.
  assert len(generate_password(8)) == 8
  assert len(generate_password(12)) == 12
  assert any(c.islower() for c in generate_password(8))
  assert any(c.isupper() for c in generate_password(8))
  assert any(c.isdigit() for c in generate_password(8))
output: import random
  import string
  
  def generate_password(length):
      if length < 3:
          raise ValueError("Password length should be at least 3")
  
      characters = string.ascii_letters + string.digits
      password = [
          random.choice(string.ascii_lowercase),
          random.choice(string.ascii_uppercase),
          random.choice(string.digits)
      ]
  
      password += random.choices(characters, k=length-3)
      random.shuffle(password)
      
      return ''.join(password)