0% found this document useful (0 votes)
2 views11 pages

Build in Functions in Python

The document provides an overview of four built-in Python functions: filter, map, reduce, and zip. Each function is described with its syntax and purpose, detailing how they operate on sequences and iterables. Additionally, it briefly mentions basic tuple operations, specifically the index and count methods.

Uploaded by

Tanveer Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views11 pages

Build in Functions in Python

The document provides an overview of four built-in Python functions: filter, map, reduce, and zip. Each function is described with its syntax and purpose, detailing how they operate on sequences and iterables. Additionally, it briefly mentions basic tuple operations, specifically the index and count methods.

Uploaded by

Tanveer Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

PYTHON

BUILD-IN FUNCTIONS
Filter()
Map()
Reduce(
) Zip()
Filter()
The filter function filters a sequence of elements based on a given predicate (a function that returns
a boolean value) and returns a new sequence containing only the elements that meet the predicate.
filter(predicate, iterable)
The predicate argument is a function that returns a boolean value and is applied to each element
in the iterable argument. The iterable argument can be a list, tuple, or any other iterable object.
Map()
The map function applies a function to each element in a sequence and returns a new
sequence containing the transformed elements. The map function has the following syntax:
map(function, iterable)
The function argument is a function that is applied to each element in the iterable argument.
The iterable argument can be a list, tuple, or any other iterable object.
Reduce()
The reduce function is a higher-order function that applies a function to a sequence and returns a
single value. It is a part of the functools module in Python and has the following syntax:
reduce(function, iterable)
The function argument is a function that takes in two arguments and returns a single value. The
iterable argument is a sequence of elements, such as a list or tuple.
Zip()
The zip() function take iterables (can be
zero or more), makes iterator that
aggregates elements based on the
iterables passed, and returns an iterator of
tuples.

zip(function, iterable)

The zip() function returns an iterator of


tuples based on the iterable object.
BASIC TUPLE
OPERATIONS
Index() and Count() Methods
THANK YOU

You might also like