use map to add two tuples

Question

Use map to add (10, 20, 30) and (40, 50, 60)

in progress 0
YashikaKhurana 55 years 2 Answers 725 views Master 0

Answers ( 2 )

  1. def adds(a,b):
    return a+b

    ans=map(adds, (10,20,30), (40, 50, 60))

  2. def myfunc(a,b):
    return a + b

    x = map(myfunc, (10, 20, 30), (40, 50, 60))

Leave an answer

Browse
Browse