execute multiple functions concurrently using threading

PHOTO EMBED

Mon Apr 11 2022 08:43:11 GMT+0000 (Coordinated Universal Time)

Saved by @taha #python

from time import sleep
import threading


def say_hi():
    while True:
        print('hi')
        sleep(1)


def say_hello():
    while True:
        print('Helloooooooooo')
        sleep(2)


threading.Thread(target=say_hi).start()
threading.Thread(target=say_hello).start()
content_copyCOPY