n = 10 nt = 10 list1 = [0.0] * n list2 = [0.0] * n list1[1] = 5.0 list2[1] = 5.0 c = 1.0 c2 = 0.25 print "0 =>", print list1 for t in range(1, nt+1): list = [0.0] * n for x in range(0, n): right = x + 1 left = x - 1 if right >= n: vright = 0.0 else: vright = list1[right] if left < 0: vleft = 0.0 else: vleft = list1[left] list[x] = c2 * (vright + vleft - (2*list1[x])) - list2[x] + (2 * list1[x]) print "%d =>" % t, print list list2 = list1 list1 = list print list