So, I have 8 randomly generated numbers, all referenced with ct[i]. I want to add a number (ct[i]) with the one referenced by ct[i+1]. However, this produces a list index out of range error. What's wrong?
for i in range(totrange):
tot1 = ct[i] + ct[i+1]
totrange is usually 8, but I wanted to have a bit of flexibility.
ctto... what? Wheniis7(which it will be iftotrangeis usually8),ct[i+1]will be out of bounds.