samedi 6 décembre 2014

Could someone help me what's wrong with the 5th line? It shows invalid syntax. Thanks a lot!



import math def x_coordinate(total): addx = [] limit = int(math.floor(math.sqrt(total-1)) for i in range(1, (limit+2)): if i % 2 == 1: for n in range(i): addx.append(1) for n in range(i): addx.append(0) elif i % 2 == 0: for n in range(i): addx.append(-1) for n in range(i): addx.append(0) del addx[(total-1):] return addx total = 20 a = list.x_coordinate(total) print(a)








0 commentaires:

Enregistrer un commentaire