threading the output generated by this program is illustrated belowstarting abcdone abcacbabcabccbaabcabcabcbac notice that the main thread is finished after the worker threads have only printed out single letter eachhowever as long as there is at least one non-daemon thread running the program will not terminateas none of these threads are marked as daemon thread the program continues until the last thread has finished printing out the tenth of its letters also notice how each of the threads gets chance to run on the processor before it sleeps againthus we can see the letters ab and all mixed in together extending the thread class the second approach to creating thread mentioned earlier was to subclass the thread class to do this you must define new subclass of thread override the run(method define new __init__(method that calls the parent class __init__(method to pass the required parameters up to the thread class constructor this is illustrated below where the workerthread class passes the nametarget and daemon parameters up to the thread super class constructor once you have done this you can create an instance of the new workerthread class and then start that instance print('starting' workerthread( start(print('\ndone'