I am new to python, and I am trying to run the code given below. But it keeps throwing an error:
int object not iterable.
I want to calculate the sum of sqaures in an array. Here is the code. The variable product is already defined, so that is not the worrisome part.
def sumofsquares(x1):
result=[]
for i in range (len(x1)):
result.append(sum((x1)[i]**2))
return result
print (sumofsquares(product))
product?