''' this code use python for loop syntax ''' for i in range(0,3): print i print "xrange" for i in xrange(0,3): # xrange is memory efficient print i print "steps" for i in range(0,10,3): print i
Output:
0 1 2 xrange 0 1 2 steps 0 3 6 9
''' this code use python for loop syntax ''' for i in range(0,3): print i print "xrange" for i in xrange(0,3): # xrange is memory efficient print i print "steps" for i in range(0,10,3): print i
0 1 2 xrange 0 1 2 steps 0 3 6 9
0 comments:
Post a Comment