This exercise implements the problem we used for Java in Python. The description is repeated here.
We want to find the number in a range of positive numbers which has the maximum number of divisors. A divisor is a number which divides another number with remainder 0. For example, 9 has two divisors, namely 3 and 1, whereas 8 has three, namely 1,2, and 4 (if the 1 is included or not does not matter for the maximum).
As a first step, write a program which finds the divisors for a number.
Then extend this to find the maximum number of divisors for a range in a sequential fashion. Try this out for eg the range from 1 to 1000 and 1 to 10,000. Record how long it takes for 1 to 10,000.
Finally, implement a concurrent version. Implementations using ThreadPoolExecutor from threading or ProcessPoolExecutor should look very similar. You can start with one of them and then change the code as needed for the other one. The implementation strategy can be similar to what we did in Java, i. e. write a function which finds the maximum for a range. Then write a program which uses this function with threading or multiprocessing to calculate the maximum for the range of 1 to 10,000. You can play with the number of threads/processes.