k = 1 for i in range(1, 11): a = [] for j in range(1, i + 1): a.append(k) k = k + 2 print(a, sum(a))
To embed this program on your website, copy the following code and paste it into your website's HTML: