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)
samedi 6 décembre 2014
Filled Under:
Recent Questions - SharePoint Stack Exchange
Could someone help me what's wrong with the 5th line? It shows invalid syntax. Thanks a lot!
Posted By:
Unknown
on 12:06
Inscription à :
Publier les commentaires (Atom)

0 commentaires:
Enregistrer un commentaire