input: Write a python function to generate an 8-character password containing letters and numbers.
  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: import random
  import string
  
  def generate_password():
      characters = string.ascii_letters + string.digits
      password = ''.join(random.choice(characters) for _ in range(8))
      while not (any(c.islower() for c in password) and
                 any(c.isupper() for c in password) and
                 any(c.isdigit() for c in password)):
          password = ''.join(random.choice(characters) for _ in range(8))
      return password