To implement the concept of map, filter in python3.
map() is a function which takes twoarguments.
Applies a function to all the items inan input_list.
It used to number of coding lines inthe program.
Filter function is used to filter outall the elements of a sequence.
The filter resembles a for loop but itis a built-in function and faster.
#map function
num_list = [1, 2, 3, 4, 5]
square = list(map(lambda x: x**2, num_list))
print(“Square of the list is:\n”)
print(square)
print(“\n”)
#filter function
num_range = range(-6, 6)
positive_values = list(filter(lambda x: x > 0, num_range))
print(“Positive number in the given range is:\n”)
print(positive_values)