It seems like you are trying to use an array and an int with the operand “**” althought it expects two ints or at least two numbers. Maybe you want to use sum_x or sum_xy as the first argument instead?
solved how do you address type error in python [duplicate]