Skip to content

Commit 8e92226

Browse files
Create 01_createThreads
1 parent 8926970 commit 8e92226

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

01_createThreads

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import threading
2+
3+
def worker(num):
4+
# Threaded Worker function
5+
print(num)
6+
return
7+
8+
threads = []
9+
for i in range(5):
10+
t = threading.Thread(target=worker,args=(i,))
11+
threads.append(t)
12+
# Run the thread
13+
t.start()

0 commit comments

Comments
 (0)