input: Write a python function to generate a random string of length 10 containing both letters and digits.
  assert len(random_str()) == 10
  assert all(c.isalnum() for c in random_str())
  assert random_str() != random_str()
output: import random
  import string
  
  def random_str():
      characters = string.ascii_letters + string.digits
      return ''.join(random.choice(characters) for _ in range(10))