🔒 Mod previzualizare. Primele cincisprezece lecții Foundations sunt gratuite; aceasta este Pro. Pornește un trial de 7 zile pentru a debloca editorul, sugestiile AI și restul programului. Card necesar, anulează oricând în Dashboard.Pornește trial de 7 zile →
📝 **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.
Prezice ieșirea
Citește codul cu atenție
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)