Apr-27-2020, 09:10 PM
def square(x):
return x * x
def my_calculation(x, y):
result = []
for i in y:
result.append(x(i))
return result
squares = my_calculation(square, [1, 2, 3, 4, 5])
print(squares) sorry everyone, i am a beginner! in these codes i did not understand why we have to do ?
"result.append(x(i))or if anyone can explain me all steps, would be much appreciated.
thanks again.
