• Skip to primary navigation
  • Skip to content
  • Skip to footer
>>> import diegor just another special module
  • CV
  • Posts
    Diego Russo

    Diego Russo

    Software Engineer

    • Cambridge, UK
    • GitHub
    • LinkedIn
    • BlueSky
    • X
    • Facebook
    • Instagram
    • Email

    HOWTO: use multiple args to map function where one argument is fixed in python

    less than 1 minute read

    import functools
    
    def function(x, y):
    return x + y
    
    arg_list = [1,2,3,4]
    
    # we fix y=10
    map(functools.partial(function, y=10), arg_list)
    
    # [11, 12, 13, 14]
    

    Tags: python

    Categories: english, howto

    Updated: January 31, 2014

    Share on

    X Facebook LinkedIn Bluesky
    Previous Next

    Comments

    You May Also Enjoy

    Help with COVID-19 research - protein folding on Raspberry Pi4

    2 minute read

    Hello, it has been a while since I wrote here last time.

    The must-read Python’s PEPs

    6 minute read

    As Python developer, you should know what a PEP is. In case you don’t, “PEP stands for Python Enhancement Proposal. A PEP is a design document providing i...

    Goodbye Wordpress, hello Github (Jekyll)

    2 minute read

    It has been a while I’m not writing in this blog. I have my reasons but the main one is because I’ve been busy migrating the whole website from Wordpress to ...

    Having fun with micro:bit and micropython

    1 minute read

    Last night I attended the usual CamPUG monthly meeting and the main topic was about micro:bit and micropython.


    • GitHub
    • LinkedIn
    • BlueSky
    • X
    • Facebook
    • Instagram
    • Feed
    © 2025 >>> import diegor. Powered by Jekyll & Minimal Mistakes.