- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
from threading import Thread
from time import sleep
for i in range(4):
print(type(i))
def f(i):
if int(i) == 1:
print('i=',i)
elif i == 2:
print('i=',i)
elif i == 3:
print('i=', i)
t = Thread(target=f, args=(i,))
t.start()
sleep(1)
print(i)