Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Explain the different types of Mergers.

Answered: 1 week ago

Question

What is dividend payout ratio ?

Answered: 1 week ago

Question

Calculate the lifetime value (LTV) of a loyal customer.

Answered: 1 week ago

Question

Use service tiering to manage the customer base and build loyalty.

Answered: 1 week ago