Answers for "value in interval python"

2

how to set interval in python

# This runs test() function in intervals of 1 second
from threading import Timer
run = True
def test():
	global run
	print("something")
	if run:
		Timer(1, test).start()

test()
# now whenever you set run to False the test function won't run anymore
# and of course if you dont set it to False it will run forever
Posted by: Guest on December-22-2020
12

python check if number is in range

if 10000 <= number <= 30000:
    pass
Posted by: Guest on April-03-2020

Python Answers by Framework

Browse Popular Code Answers by Language