Write a python function that takes in a list and returns a list containing the squares of the elements of the input list


Topic: Write a python function that takes in a list and returns a list containing the squares of the elements of the input list

Solution

def square_list_elements(list_to_be_squared):
    return list( map(lambda x: x**2, list_to_be_squared) )



List all Python Programs