Question: Write a function called square _ all that takes an input called collection that you assume to be a list or tuple of numbers. This
Write a function called squareall that takes an input called collection that you assume to be a list or tuple of numbers.
This function should return a new list, which contains the square of each value in collection.
To do so inside the function, you will define a new list, use a loop to loop through the input list, use an operator to square the current value, and use the append method to add this to your output list. After the loop, return the output list. use pythonQ Square Everything points
Write a function called squareall that takes an input called collection that you assume to be a list or tuple of numbers.
This function should return a new list, which contains the square of each value in collection.
To do so inside the function, you will define a new list, use a loop to loop through the input list, use an operator to square the current value, and use the
append method to add this to your output list. After the loop, return the output list.
In :
In : # you can use this cell to testexecutecheck your thinking optional
In : :
In : assert callablesquareall
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
