KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Given the following function f with two arguments, what is the standard way to apply map to only x? def f (x,y): print x,y More specifically, I would like to perform the following operation with map in one line. list=[1,2,3] fixed=10 for s in list: f(s,fixed) One way to do so is: import functools map(functools.partial(lambda x,y:f(y,x),fixed),list) What is a better way?
Tags (comma-separated)
Save Edits
Cancel