diff options
author | Anish Mangal <anish@sugarlabs.org> | 2011-02-22 22:56:40 (GMT) |
---|---|---|
committer | Anish Mangal <anish@sugarlabs.org> | 2011-02-22 22:59:20 (GMT) |
commit | ef3edc36c1a1c06f19823bc7b99a880c48675dfa (patch) | |
tree | e386bac518eaee9b36141aee289a08ce69452e8e /data/math/pascal | |
parent | d29d28ba5390048d5b170cc9ca410bab50012ea8 (diff) |
pep8 and pylint fixes for examples
Diffstat (limited to 'data/math/pascal')
-rw-r--r-- | data/math/pascal | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/data/math/pascal b/data/math/pascal index 359acdd..06fab84 100644 --- a/data/math/pascal +++ b/data/math/pascal @@ -1,19 +1,18 @@ # Pascal's triangle lines = 9 - vector = [1] -for i in range(1,lines+1): - vector.insert(0,0) - vector.append(0) +for i in range(1, lines + 1): + vector.insert(0, 0) + vector.append(0) -for i in range(0,lines): - newvector = vector[:] - for j in range(0,len(vector)-1): - if (newvector[j] == 0): - print " ", - else: - print "%2d" % newvector[j], - newvector[j] = vector[j-1] + vector[j+1] - print - vector = newvector[:] +for i in range(0, lines): + newvector = vector[:] + for j in range(0, len(vector) - 1): + if (newvector[j] == 0): + print ' ', + else: + print '%2d' % newvector[j], + newvector[j] = vector[j - 1] + vector[j + 1] + print + vector = newvector[:] |