input: Write a python function to generate an 8-character string with uppercase letters, lowercase letters, and digits.
  assert len(generate_code()) == 8
  assert any(c.islower() for c in generate_code())
  assert any(c.isupper() for c in generate_code())
  assert any(c.isdigit() for c in generate_code())
output: import random
  import string
  
  def generate_code():
      characters = string.ascii_letters + string.digits
      return ''.join(random.choice(characters) for _ in range(8))