Python3 multithreading problem

how to make a multithreaded child thread execute one and then another

for T in range (len (answers)):

submitdata = answers[T]
thread = threading.Thread(target=self.threading_run,args=(T,));
thread.start()

import time, threading

balance = 0
lock = threading.Lock ()

def change_it (n):

-sharp 0:
global balance
balance = balance + n
balance = balance - n

def run_thread (n):

for i in range(100000):
    -sharp :
    lock.acquire()
    try:
        -sharp :
        change_it(n)
    finally:
        -sharp :
        lock.release()

T1 = threading.Thread (target=run_thread, args= (5,))
T2 = threading.Thread (target=run_thread, args= (8,))
t1.start ()
t2.start ()
t1.join ()
t2.join ()
print (balance)
Why locks report errors, and I can"t even use multithreading

lock = threading.Lock()

AttributeError: module "threading" has no attribute" Lock"

Mar.16,2021

implement thread Synchronize with threading.Lock locks.

< hr >

Please use for item of arr: to traverse another array, not for i in range (len (arr)):

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37315-2c05b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37315-2c05b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?