Triple the number

I have a list = [1,2,3,4,5] which should triple the each element in list by using ‘def’ function and ‘lambda’ function. or ‘def’ function or ‘lambda’ function in individual way.

1 Like

@shivakumar271195

def triple(num):
return map(lambda x: x ** 3, num) [Consider the indentation here]

list = [1,2,3,4,5]
triple(list)