palindrome(s): with ThreadPoolExecutor(16) as executor: return all(executor.map( lambda t: t[0] == t[1], [ (s[i], s[-(i+1)]) for i in range(len(s)//2)]))
from concurrent.futures.process import ProcessPoolExecutor def equals(t): return t[0] == t[1] def palindrome(s): with ProcessPoolExecutor() as executor: return all(executor.map( equals, [ (s[i], s[-(i+1)]) for i in range(len(s)//2)]))