1import threading
2import time
3
4def infiniteloop1():
5 while True:
6 print('Loop 1')
7 time.sleep(1)
8
9def infiniteloop2():
10 while True:
11 print('Loop 2')
12 time.sleep(1)
13
14thread1 = threading.Thread(target=infiniteloop1)
15thread1.start()
16
17thread2 = threading.Thread(target=infiniteloop2)
18thread2.start()
19