Python Programming Tutorial – 50 – map

Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Kartheyan Sivalingam says:

list comprehension is a sensible alternative to map() new_list = [func(x) for x in someList]

naif abdul khader says:

how to write this same code with “for” command??… pls let me know quickly

Isaac says:

why not:
new_income = [double_money(i) for i in income]

Dk02 says:

I like ur voice lol

Eyal Pery says:

Let’s use Lambda 🙂

print(list(map(lambda x: x*2, [10,30,75])))

Enock Kwesi Addey says:


Rambrus0 says:

i dont understand what does this.

Kalaivany Sivalingam says:

Further topics you could cover:
-Regular Expressions
-CGI Programming
-Database Interactions
-List comprehension
-Decorators (Including standard decorators built into Python, e.g @staticmethod)
-super() function
-enumerate() function
-C extensions
-Other modules part of Python’s standard library (hashlib, pickle etc)

Third party libraries you could teach:
-Twisted (Event driven networking library)
-Django (Web framework – like Flask, but better imo)

Good luck! Most of these topics lack good videos, so it would be great if you could cover them

Jack Scott says:

Is anyone having issues with importing AF_PACKET from sockets? PyCharm isn’t recognizing it for me.

n Wood says:

I played with the above in idle, it seems that you don’t need list in front of the map function, as map will return a list eg
>>> income=[10,20,30]
>>> def d(d):
return d*2

>>> ans=map(d,income)
>>> type(ans)

>>> ans
[20, 40, 60]

DavidAnatolie says:

I wrote a lambda function instead of defining one.

Batman says:

or you can do something like this:


def magic_number(number):
magic= number*2+10/2


salsa4u says:

why does it double the income if the double is in the double money function, I dont understand the logic?

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!