There is nothing to stop you combining the map
operation with the fold
operation. You can even apply map
more than once in order
to generate more complex mappings. For bonus marks, see if you can work out how to use map
and fold
to calculate the average of
the square root of all the numbers from 1 to 1000. i.e the sum of the square roots of all the numbers divided by 1000.
Call your new program squareroot_spark.py
and commit it to the repository you used for Assignment 3.