i2:

def fun(n):

i2=0

def fun2(n):

s=0

nonlocal i2

for i in range(n):

i2=i*i

s+=i2

return s

fun2(2*n)

print("i2=",i2)

 

fun(10)