Skip to content
Advertisement

How to obtain a value from inside a loop

I will be implementing multiprocessing so that the loops are occurring at the same time, but how can I make it so at the end of each iteration, I can obtain the value of westernEurope.cases and easternEurope.cases so that I can add them together

JavaScript

Advertisement

Answer

IMHO there is no need for multiprocessing. With a generator, your problem can be solved in an even more elgant way.

JavaScript

Full code:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement