Sitemap
Mian

Mian

Self Motivated, Naive Programmer.

“Built in Methods” In Python

3 min readJul 22, 2025

--

Let’s start diving into Built in Methods , to make our lives easy 😃.

print("Hola! Built in Methods in Python 😄!)
Press enter or click to view image in full size
ummm … 😟

Built in Methods are methods or functions that comes with Python, they let’s us do several task much easier way then we can expect, by already writing the core logic behind those method, and as programmers we have to call those methods and pass the desired arguments.

Here’s the bonus tip!

Press enter or click to view image in full size

This allows us to see the documentation for any method we like, giving us insight about

  1. Method’s Description
  2. Parameters

Don’t worry guys I got you!

Let’s get started, by learning some important Built in method, as follows:

  1. Map()
  2. Filter
  3. Zip

LET’S START LEARNING!

1. Map()

Press enter or click to view image in full size
Parameter

The map functions contains following parameters:

  1. function
  2. iterate able object
Press enter or click to view image in full size
Implementation ⭐️

Here we defined a function, and then using map method we called the function, and also passing the iterate able object which is list “phone_brand”.

Get Mian’s stories in your inbox

Join Medium for free to get updates from this writer.

Wait wait wait…

Whats the list Constructor doing there?

As you know the output for map method here is a list of numbers that are the length for each phone brands length, but we need to store them as a list, that’s why we use list constructor.

Press enter or click to view image in full size

The output if we print phone_brand_len 😃.

2. Filter ()

Press enter or click to view image in full size
Parameter

Filter methods contains two parameters,

  1. function
  2. iterate able object
Press enter or click to view image in full size
Implementation

Firstly we created a list of numbers, and the we defined a method which checks if a number is less then 20 or NOT.

Then we call filter method and pass the compare function along with the list of numbers. And the converted the output of filter method into a List.

Finally printed the result.

Press enter or click to view image in full size
Output

Wait Wait Wait…

What is difference between Map and Filter method then?

Basically Map Function returns all the values, however Filter Function return only those values that satisfies the condition according the function passed to Filter Function as an “argument”.

3. Zip()

Press enter or click to view image in full size
Parameters

Zip methods takes argument which is Iterate able Objects.

Press enter or click to view image in full size
Implementation

Here we created two arrays, one containing alphabets and other containing numbers.

We called Zip method, and passed both lists as an argument, and use list constructor to return a list.

Press enter or click to view image in full size
Output

Umm… Interesting 😄.

If you have noticed that both lists have different length size

  1. alphabets length was 4
  2. numbers length was 6

Point to note that Zip method will work using the length of iterate able object with minimum length.

So was it all?

No! still many Built in Methods left, but these were my favorite !

print("Don't Forget to explore at your Own 👌!")

--

--