You have been provided with a list of words. Your task is to write a Python program to compute the length of each word using the apply method of the Pool class for parallel processing.
Multiprocessing pool
Parallel word length calculation using apply method
Report a typo
Sample Input 1:
fast efficient streamingSample Output 1:
4 9 9Write a program in Python 3
from multiprocessing import Pool
def parallel_word_length(words, num_processes):
# Your code here
words = input().split()
num_processes = 4
result = parallel_word_length(words, num_processes)
print(*result)
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.