Python Programming Tutorial – 50 – map

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

15 responses to “Python Programming Tutorial – 50 – map”

  1. Shibon Skaria Avatar

    As simple as that!

  2. Paweł Brysch Avatar

    3:00 lista_przekształcona = list(map(przekształcenie, lista)) – prawdopodobnie nie można robic działań na listach

  3. salsa4u Avatar

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

  4. DavidAnatolie Avatar

    I wrote a lambda function instead of defining one.

  5. Jack Scott Avatar

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

  6. n Wood Avatar

    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)
    <type 'list'>
    >>> ans
    [20, 40, 60]
    >>>

  7. naif abdul khader Avatar

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

  8. Dk02 Avatar

    I like ur voice lol

  9. Isaac Avatar

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

  10. Eyal Pery Avatar

    Let's use Lambda 🙂

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

  11. Batman Avatar

    or you can do something like this:

    nub=[45,23,23,89,456,789,123,890]

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

    list(map(magic_number,nub))

  12. Kalaivany Sivalingam Avatar

    Further topics you could cover:
    -Regular Expressions
    -Networking
    -CGI Programming
    -Database Interactions
    -optparse
    -Generators
    -Iterators
    -List comprehension
    -Decorators (Including standard decorators built into Python, e.g @staticmethod)
    -super() function
    -enumerate() function
    -sockets
    -C extensions
    -Templates
    -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

  13. Rambrus0 Avatar

    i dont understand what does this.

Leave a Reply

Your email address will not be published. Required fields are marked *