input: Write a function to generate a random password that consists of 8 characters. The function should use a combination of uppercase and lowercase letters, as well as digits.
  
  def generate_password():
      import string
      import random
      chars = string.ascii_letters + string.digits
      return ''.join(random.choice(chars) for _ in range(8))
  
  assert len(generate_password()) == 8
  assert any(c.islower() for c in generate_password())
  assert any(c.isupper() for c in generate_password())
  assert any(c.isdigit() for c in generate_password())
output: def generate_password():
      import string
      import random
      chars = string.ascii_letters + string.digits
      return ''.join(random.choice(chars) for _ in range(8))