Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

limiting a for each loop python

from itertools import islice  
  
for i in islice(range(20), 1, 5):  # islice(items, start, stop, step)
    print(i)
# Output:
# 1 2 3 4
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #limiting #loop #python
ADD COMMENT
Topic
Name
5+5 =