input: Write a function to generate a random password consisting of 8 characters. The password should include both uppercase and lowercase letters, and digits. If called, the function should return a string composed of those characters.
  
  def generate_password():
      chars = string.ascii_letters + string.digits
      return ''.join(random.choice(chars) for _ in range(8))
  
  assert len(generate_password())==8
  assert any(char.isdigit() for char in generate_password())==True
  assert any(char.islower() for char in generate_password())==True
  assert any(char.isupper() for char in generate_password())==True
output: def generate_password():
      import random
      import string
      chars = string.ascii_letters + string.digits
      return ''.join(random.choice(chars) for _ in range(8))