Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

loop through 2 items python

#----------- For loop using 2 items of a list --------------- #
mylist = [117, 202, 287, 372, 457, 542]

#range() has a third parameter allowing you to specify step size, letting you loop through more than 1 item at a time
#range(start, end, stepsize)
for i in range(0, len(mylist), 3):
	print(mylist[i])
 
PREVIOUS NEXT
Tagged: #loop #items #python
ADD COMMENT
Topic
Name
4+6 =