import time
alpha = 0
beta = 0
while True:
alpha = alpha + 1
print("Сейчас alpha: ", alpha)
time.sleep(1)
while True:
beta = beta + 1
print("Теперь beta: ", beta)
time.sleep(10)
while True:
alpha = alpha + 1
print("Сейчас alpha: ", alpha)
time.sleep(1)
beta = beta + 1
print("Теперь beta: ", beta)
time.sleep(10)
import time
from threading import Thread
alpha = 0
beta = 0
def alpha_bg(alpha):
while True:
alpha = alpha + 1
print("Сейчас alpha: ", alpha)
time.sleep(1)
if __name__ == '__main__':
x = Thread(target=alpha_bg, args=(alpha,))
x.start()
while True:
beta = beta + 1
print("Теперь beta: ", beta)
time.sleep(10)