input: Write a function to generate a random password of length between 8 to 10 characters.
  assert len(generate_password()) in [8, 9, 10]
  assert isinstance(generate_password(), str)
  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: import random
  import string
  
  def generate_password():
      length = random.randint(8, 10)
      all_characters = string.ascii_letters + string.digits
      password = ''.join(random.choice(all_characters) for _ in range(length))
      while (not any(c.islower() for c in password) or
             not any(c.isupper() for c in password) or
             not any(c.isdigit() for c in password)):
          password = ''.join(random.choice(all_characters) for _ in range(length))
      return password