- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstep13_thread.py
More file actions
Latest commit
23 lines (18 loc) · 536 Bytes
/
Copy pathstep13_thread.py
File metadata and controls
23 lines (18 loc) · 536 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
importthreading
max_loop_count=10
k=[]
k.append(0)
classMyThread (threading.Thread):
defrun(self):
foriinrange(max_loop_count):
k[0] =i
print("Value of i = ",i)
ifk[0]!=i:
print("This cant print ######################## from thread")
thread1=MyThread()
thread1.start()
print("Started thread");
forjinrange (max_loop_count):
print("************Value of j =",j)
ifk[0] !=j:
print("This cant print ######################## from main")