Cool things you can do with map in python

Photo by Marjan Blan | @marjanblan on Unsplash

What is a map() function?

Map with normal functions

Square the numbers in the list using a normal function

map() with a custom function

Remove punctuations with the map function

Removing punctuations using the map() function

Map with lambda functions

lambda arguments : expression

Square the numbers in the list using a lambda function

square numbers using map and lambda function
cube numbers using map and lambda function

Map function with two arguments

Map function with built-in functions

Change the data type of the values

map function with int datatype

Find the length of the string

map function with len

Using math functions with the map function

map function with ceil

Round the values using the map function

map function with round

Generate a list of numbers

map function with range

Get absolute value of the numbers

map function with abs

Map with filter

Square of positive integers using map and filter

map with filter

Conclusion

Python Developer | Django Developer | Python Enthusiast