input: Write a python function to generate a random string of 7 characters consisting of letters and numbers.
  assert len(random_string()) == 7
  assert isinstance(random_string(), str)
  assert all(c.isalnum() for c in random_string())
output: import random
  import string
  
  def random_string():
      characters = string.ascii_letters + string.digits
      return ''.join(random.choice(characters) for _ in range(7))