🔒 Način pregleda. Prvih petnaest Foundations lekcija je besplatno; ova je Pro. Pokrenite 7-dnevni trial da otključate editor, AI savjete i ostatak programa. Kartica obavezna, otkažite bilo kada u Dashboard.Pokreni 7-dnevni trial →
📝 **Task:** Predict what the code prints. Hint: pool.map keeps input order.
📋 Edit the starter code below. Tests run automatically.
💡 **Hint:** Re-read the theory if you get stuck.
Predvidi izlaz
Pažljivo pročitaj kod
from concurrent.futures import ThreadPoolExecutor
def double(x):
return x * 2
with ThreadPoolExecutor(max_workers=2) as pool:
results = list(pool.map(double, [1, 2, 3]))
print(results)