Zum Hauptinhalt springen
🔒 Vorschaumodus. Die ersten fünfzehn Foundations-Lektionen sind kostenlos; diese hier ist Pro. Starte einen 7-Tage-Trial, um den Editor, AI-Hinweise und den Rest des Lehrplans freizuschalten. Karte erforderlich, jederzeit im Dashboard kündbar.7-Tage-Trial starten →
⚡
← Kurse›Python FoundationsModul 6 · Parallelität und Parallelität›ThreadPoolExecutor – Vorhersage der Ausgabepredict139 / 174
+100 XP
Aufgabe🌐 shown in EN
📝 **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.
Sage die Ausgabe vorher

Lies den Code sorgfältig

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)

Was wird das Programm ausgeben? Schreib hier: