Vai al contenuto principale
๐Ÿ”’ Modalitร  anteprima. Le prime quindici lezioni di Foundations sono gratuite; questa รจ Pro. Avvia un trial di 7 giorni per sbloccare l'editor, i suggerimenti AI e il resto del programma. Carta richiesta, disdici in qualsiasi momento dalla Dashboard.Avvia trial di 7 giorni โ†’
โšก
โ† Corsiโ€บPython FoundationsModulo 6 ยท Concorrenza e parallelismoโ€บNozioni di base sul threading: prevedere l'outputpredict135 / 174
+100 XP
Compito๐ŸŒ shown in EN
๐Ÿ“ **Task:** Predict what the program prints.\n\nThe thread runs \`worker("A")\` to completion (\`join()\` waits), then the main thread continues. Output is deterministic because start+join serializes execution.\n\nExpected: two lines. ๐Ÿ“‹ Edit the starter code below. Tests run automatically. ๐Ÿ’ก **Hint:** Re-read the theory if you get stuck.
Predici output

Leggi il codice attentamente

import threading

def worker(name):
    print(name)

t = threading.Thread(target=worker, args=("A",))
t.start()
t.join()
print("done")

Cosa stamperร  il programma? Scrivi qui: