Answer:
total=0
def calcsumnumsquare(k,total):
while k>=1:
total+=int(k)*int(k)
k-=1
return total
print(calcsumnumsquare(4,0))
Explanation:
The program required is written above. It uses only two variables k and total as mentioned in the question. And the total is initially set to 9, and then its value is incremented by the square of each k during each loop established by while loop. And finally, when k=1, the output is returned. And we have printed the return value using print.