Answers for "limiting a for each loop python"

0

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
Posted by: Guest on June-14-2021

Python Answers by Framework

Browse Popular Code Answers by Language