i2:

def fun(n):

global i2

s=0

for i in range(n):

i2=i*i

s+=i2

return s

 

print("fun(10)=",fun(10),"i2=",i2)