Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please explain this to me step by step Write a function called square(1st) that takes one parameter which is a list of integers and returns

Please explain this to me step by step

image text in transcribed

Write a function called square(1st) that takes one parameter which is a list of integers and returns a list that contains the square of each element in the given list (see the sample inputs for some examples). We have written the code to read the input from the user in the background. Also, the code challenge will call your function with many input lists and check that it behaves correctly on all of them. Your task is to only define the function as specified which will return the new list which contains the squares of each element. Sample Input 1: 1 2 3 4 Sample Output 1: [1, 4, 9, 16] Sample Input 2: 10 12 15 Sample Output 2: [100, 144, 225]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions