I try to update tuple values using another tuple.
grade = (('a', 10), ('b', 20), ('c', 30), ('d', 40))
factors = (('a', 1), ('b', 2))
Expected result:
result = (('a', 11), ('b', 22), ('c', 30), ('d', 40))
What would be the right way to do this? , I tried the following code but it did not work. I would be happy to help
print(list(filter(lambda list_a: list(map(lambda x, y: x+ y, list_a[0], grade[1])) not in list(map(lambda x: x[0], factors)), grade)))
12and why not22?