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()
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()