Write a python function that takes a list of numbers and calculate square of each number and return it in a list


Topic: Write a python function that takes a list of numbers and calculate square of each number and return it in a list

Solution

def square_num(mynumbers):
    return list(map(lambda num: num**2,mynumbers))
square_num([1,2,3])



List all Python Programs