Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use a data set that consists of the numbers from 1 to 10. (0.5 mark) Apply a map function to the data set that will
Use a data set that consists of the numbers from 1 to 10. (0.5 mark) Apply a map function to the data set that will divide the value by 2 if it is even or multiply by 3 if it is odd. Print the result after the map function is applied. (2 marks) Apply a filter function that will keep the value if it is between 5 and 20 inclusive. Print the result after the filter function is applied. (1 mark) Apply a reduce function that will add the two values if the first value is greater than the second otherwise it will multiply them. Print the result after reduce function is applied.(1 mark)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started