When list of tuples are used in for loop it works perfectly with two separate variables as below
t_dict = {
"k1": "v1",
"k2": "v2",
"k3": "v3",
"k4": "v4",
"k5": "v5"
}
for k, v in t_dict.items():
print "%s=%s" % (k, v)
But when converted into lambda with map function got an error as below
print map(lambda k, v: "%s=%s" % (k, v), t_dict.items())
Traceback (most recent call last): File "test.py", line 14, in <module>
print map(lambda k, v: "%s=%s" % (k, v), t_dict.items()) TypeError: <lambda>() takes exactly 2 arguments (1 given)
Is there any other way to call list of tuple in lambda function?