Quiz Catalog

Catalog of quizzes

import multiprocessing

def fact(value, answer):
  if value == 0:
  answer["value"] = 1
  answer["value"] = 1
  for i in range(1, value + 1):
  answer["value"] *= i

answer = {
  "value": 0
}

th = multiprocessing.Process(target=fact, args=(5, answer))

th.start()
th.join()

print(answer["value"])
0
  • thread/parameter