Quiz 1

Test what you have learnt so far.

We'll cover the following...

Question # 1

Consider the below snippet:

def thread_task():
    print("{0} executing".format(current_thread().getName()))


myThread = Thread(group=None,  # reserved
                  target=thread_task(),
                  name="childThread")

myThread.start()
myThread.join()

Technical Quiz
1.

What will be the output of the above snippet?

A.

MainThread executing

B.

childThread executing

C.

Runtime Error occurs


1 / 1
Press + to interact
Python 3.5
from threading import Thread
from threading import current_thread
def thread_task():
print("{0} executing".format(current_thread().getName()))
myThread = Thread(group=None, # reserved
target=thread_task(),
name="childThread")
myThread.start()
myThread.join()

Question

What ...