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