Search
 
SCRIPT & CODE EXAMPLE
 

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])
Comment

PREVIOUS NEXT
Code Example
Python :: separate path python 
Python :: or operator in django queryset 
Python :: randomly choose between two numbers python 
Python :: how to read then overwrite a file with python 
Python :: drop a row with a specific value of a column 
Python :: pickle load pickle file 
Python :: get first row sqlalchemy 
Python :: show all urls django extensions 
Python :: remove first character from string python 
Python :: how to check if a cell is empty in openpyxl 
Python :: how to import include in django 
Python :: Return a Series containing counts of unique values. 
Python :: sort by multiple keys in object python 
Python :: view(-1) in pytorch 
Python :: import csv from google drive python 
Python :: pandas python group by for one column and sum another column 
Python :: how to get a hyperlink in django 
Python :: python pillow resize image 
Python :: how to get how many rows is in a dataframe? 
Python :: python replace char in string 
Python :: how to check if text is in upper case in python 
Python :: how to change column name in pandas 
Python :: loop through python object 
Python :: pygame key pressed once 
Python :: skip error python 
Python :: python sleep 1 second 
Python :: override python print for class 
Python :: python merge dictionaries 
Python :: -1 in numpy reshape 
Python :: discord bot python delete messages like mee6 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =