Python multiprocessing example not working

I am trying to learn how to use multiprocessing but I can’t get it to work. Here is the code:

import multiprocessing

p1 = multiprocessing.Process(target=print_cube, args=(3,))

p2 = multiprocessing.Process(target=print_square, args=(4,))
p1.start()
p2.start()

p1.join()
p2.join()

print(“Done”)

It print “Done” to the screen only.

Hello Ishrat, where have you defined the functions print_cube and print_square ??
Please let me know this, I will help you out.
Thanks :slight_smile:
Happy Coding !!