Question: Problem 7 ( Plz help me ) this is a beginner python class. do not use any advanced syntax I need to understand it Define

Problem 7(Plz help me) this is a beginner python class. do not use any advanced syntax I need to understand it
Define a function called square that accepts the integer parameter num and returns the square of num.
Define a function called myMap that accepts two arguments: a function func and a list myList. The function does the following:
Initialize result to an empty list.
Iterate over myList:
A. Calls func (not square) with the current list element.
B. Append the value returned by func to result.
Return result
In []: # write the functions below
# Do not change the code below
myList =[1,2,3]
result = myMap(square, myList)
print('The square of ever element in', mylist, 'is', result)
Expected Output:
The square of ever element in 1,2,3 is 1,4,9
 Problem 7(Plz help me) this is a beginner python class. do

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!