Answers for "run for 2 time a loop in py"

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
0

how to run loops 3 times in python

number1 = 0
number2 = 0
number3 = 0

for i in (number1, number2, number3):
    i = int(input("Enter number: "))
Posted by: Guest on April-14-2021

Python Answers by Framework

Browse Popular Code Answers by Language