line=[]
dot=range(dots)
def generate():
global dot
for i in range(dots):
dot[i][0] = random.randrange(0, dots)
dot[i][1] = random.randrange(0, dots)
TypeError: 'int' object does not support item assignment
dot=range(dots)
[0, 1, 2... dots-1]
dot = [] # вот пустой лист
for i in range(dots):
# добавляю в него листы вида [x, y]
dot.append([random.randrange(0, dots), random.randrange(0, dots)])