that has been executing the time sleep( callpauses for seconds after it wakes from its -second napit prints 'wake up!and then returns from the takeanap(function chronologically'wake up!is the last thing printed by the program normally program terminates when the last line of code in the file has run (or the sys exit(function is calledbut threaddemo py has two threads the first is the original thread that began at the start of the program and ends after print('end of program 'the second thread is created when threadobj start(is calledbegins at the start of the takeanap(functionand ends after takeanap(returns python program will not terminate until all its threads have terminated when you ran threaddemo pyeven though the original thread had terminatedthe second thread was still executing the time sleep( call passing arguments to the thread' target function if the target function you want to run in the new thread takes argumentsyou can pass the target function' arguments to threading thread(for examplesay you wanted to run this print(call in its own threadprint('cats''dogs''frogs'sep='cats dogs frogs this print(call has three regular arguments'cats''dogs'and 'frogs'and one keyword argumentsep=the regular arguments can be passed as list to the args keyword argument in threading thread(the keyword argument can be specified as dictionary to the kwargs keyword argument in threading thread(enter the following into the interactive shellimport threading threadobj threading thread(target=printargs=['cats''dogs''frogs']kwargs={'sep''}threadobj start(cats dogs frogs to make sure the arguments 'cats''dogs'and 'frogsget passed to print(in the new threadwe pass args=['cats''dogs''frogs'to threading thread(to make sure the keyword argument sep=gets passed to print(in the new threadwe pass kwargs={'sep'''to threading thread(the threadobj start(call will create new thread to call the print(functionand it will pass 'cats''dogs'and 'frogsas arguments and for the sep keyword argument this is an incorrect way to create the new thread that calls print()threadobj threading thread(target=print('cats''dogs''frogs'sep=')