passing arguments to thread from threading import thread from time import sleep def worker(msg)for in range( )print(msgend=''flush=truesleep( print('starting' thread(target=workerargs=' ' thread(target=workerargs=' ' thread(target=workerargs=' ' start( start( start(print('done'in this examplethe worker function takes message to be printed times within loop inside the loop the thread will print the message and then sleep for second this allows other threads to be executed as the thread must wait for the sleep timeout to finish before again becoming runnable three threads and are then created each with different message note that the worker(function can be reused with each thread as each invocation of the function will have its own parameter values passed to it the three threads are then started this means that at this point there is the main threadand three worker threads that are runnable (although only one thread will run at timethe three worker threads each run the worker(function printing out either the letter ab or ten times this means that once started each thread will print out stringsleep for and then wait until it is selected to run againthis is illustrated in the following diagram