import threading
import time
def infiniteloop1():
while True:
print('Loop 1')
time.sleep(1)
def infiniteloop2():
while True:
print('Loop 2')
time.sleep(1)
thread1 = threading.Thread(target=infiniteloop1)
thread1.start()
thread2 = threading.Thread(target=infiniteloop2)
thread2.start()
for i, j in zip([1,2,3], [3,2,1]):
print i, j
for i, j in zip(f_iterate1(), f_iterate2()):
print i, j