1# You can use threading
2import threading # python 3.9.1
3
4def Task_One():
5 while True:
6 print('Rawr')
7
8def Task_Two():
9 while True:
10 print('de.cxl ig <3')
11
12# Use variable or instantly start thread
13
14threading.Thread(target=Task_One).start() # Task_One()
15threading.Thread(target=Task_Two).start() # Task_Two()
1
2# ------------- For loop using 2 items of a list --------------- #
3
4# This code is trying to find if a point belongs between
5# the interval of pairing points of a list:
6
7mylist = [117, 202, 287, 372, 457, 542]
8point = 490
9# 117 < x < 202 ?
10# 287 < x < 372 ?
11# 457 < x < 542 ?
12
13for i, j in zip(mylist[::2], mylist[1::2]):
14 if i < point < j:
15 print ("This point exists between: ", i, " - ", j)
16 break
17
18
19