Answers for "python run two loops at the same time"

1

run 2 loops simultaneously python

// LOOPING SIMULTANIOUSLY
for (i,j) in zip(range(12,20),range(22,30)): 
	print(i,j)
Posted by: Guest on June-18-2021
1

python 2 loops at the same time

# You can use threading
import threading # python 3.9.1

def Task_One():
    while True:
        print('Rawr')
        
def Task_Two():
    while True:
        print('de.cxl ig <3')

# Use variable or instantly start thread
        
threading.Thread(target=Task_One).start() # Task_One()
threading.Thread(target=Task_Two).start() # Task_Two()
Posted by: Guest on January-24-2021

Code answers related to "python run two loops at the same time"

Python Answers by Framework

Browse Popular Code Answers by Language