input: Write a function to generate a random password consisting of 8 characters. The password should include both uppercase and lowercase letters, as well as digits. If the input is not applicable, the function should generate a new random password each time it is called.
  
  def generate_password():
      chars = string.ascii_letters + string.digits
      return ''.join(random.choice(chars) for _ in range(8))
  
  import string
  import random
  
  password = generate_password()
  assert len(password) == 8
  assert any(c.isdigit() for c in password)
  assert any(c.islower() for c in password)
  assert any(c.isupper() for c in password)
  
  print(password)
output: import string
  import random
  
  def generate_password():
      chars = string.ascii_letters + string.digits
      return ''.join(random.choice(chars) for _ in range(8))