I don't understand why you need all those variables. Is it not sufficient to have a loop variable that goes up in steps of 4 between the correct bounds (see
Also, your example contains the numbers 12, 52, 92 and 132, none of which are square.
range()
) and a variable to keep track of the sum?Also, your example contains the numbers 12, 52, 92 and 132, none of which are square.