Code AnalysisIntermediate 45s
ThreadPoolExecutor
What is the output?
Starter code
from concurrent.futures import ThreadPoolExecutor
def f(x): return x*x
with ThreadPoolExecutor(max_workers=2) as ex:
results = list(ex.map(f, [1, 2, 3]))
print(results)Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.