MCQs > IT & Programming > Python > Output of the following Python language code? import multiprocessing result = [] def s_p(mp): global result for num in mp: result.append(num * num+1) print('{}'.format(result)) if __name__ == '__main__': mp = [1,2,3,4] p1 = multiprocessing.Process(target=s_p, args=(mp,)) p1.start() p1.join() print('{}'.format(result))

Python MCQs

What will be the correct output of the following Python language code?

import multiprocessing

result = []

def s_p(mp):

global result

for num in mp:

    result.append(num * num+1)

print("{}".format(result))

if __name__ == "__main__":

mp = [1,2,3,4]

p1 = multiprocessing.Process(target=s_p, args=(mp,))

p1.start()

p1.join()

print("{}".format(result))


Answer

Correct Answer: [2, 5, 10, 17] []

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

More Python MCQ Questions

search

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it