Quiz 2

Test what you have learnt so far.

We'll cover the following...

Question # 1

Consider the snippet below:

from multiprocessing import Value, Lock


lock = Lock()
pi = Value('d', 3.1415, lock=lock)

lock.acquire()
print(pi.value)
lock.release()
Technical Quiz
1.

What will be the output of running the above snippet?

A.

Deadlock

B.

3.1415 is printed on the console

C.

Error is raised


1 / 1
Press + to interact
Python 3.5
from multiprocessing import Value, Lock
lock = Lock()
pi = Value('d', 3.1415, lock=lock)
lock.acquire()
print(pi.value)
lock.release()
...