import time
import threading
class test:
def printer():
for i in range(3):
print('Hello')
time.sleep(5)
def reload():
for i in range(3):
print('hey')
def upload():
print('hii')
if __name__ == '__main__':
thread1 = threading.Thread(target=printer())
thread2 = threading.Thread(target=reload())
thread3 = threading.Thread(target=upload())
thread1.start()
thread3.start()
thread2.start()
thread1.join()
thread2.join()
thread3.join()
print("bye")
print("right")
def doc():
for i in range(3):
print('good')
output:
hello
hello
hello
hey
hey
hey
hii
bye
right
I want to print def doc after thread1, thread2 and thread3 terminted...."bye" and "right" are printed by main thread but doc() didn't print. Why does it not print?