Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python for loop inside list

myList = []
for i in range(10):
    myList.append(i)
    
# is equivalent to

myList = [i for i in range(10)]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #loop #list
ADD COMMENT
Topic
Name
8+3 =