code: def random_string(length):
      
      valid_chars = string_ascii_letters + string_digits
  
      return ''.join(random.choice(valid_chars) for i in range(length))
docs: Return a pseudo-random string of specified length.