Bonjour à tous

Pourquoi ces threads s’exécutent l'un après l'autre?

Merci

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
import time
import threading
 
def loop1(identifiant):
    for i in range(1, 5):
        time.sleep(0.5)
        print(identifiant,i)
 
threading.Thread(target=loop1("A")).start()
threading.Thread(target=loop1("B")).start()

A 1
A 2
A 3
A 4
B 1
B 2
B 3
B 4