i want to ask , i try with my coding but it still not working, i want to execute 2 loop with delay and print each word with delay.
here my coding
import threading,time
def func_name1():
fruits = ["apple", "banana", "cherry"]
for i in fruits:
time.sleep(2)
print(i)
def func_name2():
fruits2 = ["1", "2", "3"]
for i in fruits2:
time.sleep(2)
print(i)
f1 = threading.Thread(target=func_name1)
f2 = threading.Thread(target=func_name2)
f1.start()
time.sleep(2)
f2.start()
output like this
apple
1
banana
2
cherry
3
i want scenario like this
