map-filter-reduce-workshop
Workshop with some programming issues that needed to be solved in a functional way
Exercises
-
Write a program which can map() to make a list whose elements are square of elements in [1,2,3,4,5,6,7,8,9,10].
-
Write a program which can map() and filter() to make a list whose elements are square of even number in [1,2,3,4,5,6,7,8,9,10].
-
Write a program which can filter() to make a list whose elements are even number between 1 and 20 (both included).
-
Write a program which can map() to make a list whose elements are square of numbers between 1 and 20 (both included).
-
Determine the maximum of a list of numerical values by using reduce.
-
Calculate the sum of the numbers from 1 to 100, use reduce.
-
Change the previous example to calculate the product (the factorial) from 1 to a number, but do not choose 50.
-
Write a Python program to filter the positive numbers from a list.
-
Find the intersection of two lists, using filter.