Python Lessons – 6.3 Map and Filter

Python lessons - 6.3 Map and Filter m

In Python, there is a built-in function called Map (), which can be very useful for high-order functions that operate on lists. In fact, this function takes a function and an Iterable object (such as a list) as arguments, and returns a new Iterable object (such as a new list) with the function applied for each argument

Continue reading

Python Lessons – 6.6 Recursions

Python Lesson - 6.6 Recursions m

Recursion is a very important concept in functional programming. A basic aspect of recursion is the self-reference of the function that invokes itself. A classic example of a function that can be implemented recursively is the factorial function. The factorial of a number is equal to the product of all the numbers from 0 to that specified number.

Continue reading

Python Lessons – 6.7 Sets

Python Lesson - 6.7 Sets m

Sets are data structures similar to lists or dictionaries. These are created using the {} brackets or the set () function directly. This data structure shares some features with lists, such as using the IN clause to find out if a particular value is contained within.

Continue reading