2016-12-03 | Paul Boddie | raw annotate files changeset graph | Implemented the inversion operator for integers. |
1 l = range(0, 10) 2 print l # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] 3 print len(l) # 10 4 5 x = xrange(0, -10, -2) 6 print x # __builtins__.span.xrange(0, -10, -2) 7 print len(x) # 5 8 9 for i in x: 10 print i # 0 11 # -2 12 # -4 13 # -6 14 # -8 15 16 x = xrange(0, -10, 2) 17 print x # __builtins__.span.xrange(0, 0, 2) 18 print len(x) # 0