I know this is a rookie question but I keep getting an error I don't usually get. "Index error: List index out of range on line 12." where it says the 2 'nums'. I thought it was perfectly fine to call variables out side of a loop?
lisp = []
new = []
for x in range(1, 11):
num = int((x * (3*x - 1))/2)
lisp.append(num)
x = 0
y = 2
for i in lisp[1:]:
num1 = lisp[x] + i
num2 = lisp[y] + i
dif1 = i - lisp[x]
dif2 = lisp[y] - i
smallList = [num1, num2, dif1, dif2]
new.append(smallList)
x += 1
y += 1
print(new)