I'm learing python(previously have a little c expericence) and am trying to solve a math problem but encountered something unexpected:
import math
list_a = list_b = [0 for k in range(10)]
print list_a[0] #test if list_a works]
for i in range(10):
list_a[i] = math.sqrt(math.pi + i**2)
print list_a[i] #value
list_b[i] = math.sqrt(list_a[i]**2 + math.pi**2)
print list_a[i] #why changed to another value?
print '-----------------'
why after this line:
list_b[i] = math.sqrt(list_a[i]**2 + math.pi**2)
the list_a[i]
changed?