input: Write a python function to generate a random password of given length that includes uppercase, lowercase, and digits.
  assert len(generate_password(8)) == 8
  assert len(generate_password(12)) == 12
  assert len(generate_password(16)) == 16
output: import random
  import string
  
  def generate_password(length):
      if length < 3:  # Ensure there is at least one uppercase, one lowercase, and one digit
          raise ValueError("Password length must be at least 3 characters")
  
      characters = string.ascii_letters + string.digits
      password = [
          random.choice(string.ascii_uppercase),
          random.choice(string.ascii_lowercase),
          random.choice(string.digits),
      ]
  
      password += random.choices(characters, k=length - 3)
      random.shuffle(password)
  
      return ''.join(password)