Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

List Comprehension generate a list

# generate a list
li = [ i+1 for i in [1,2,3] ]
print(li)
# [2, 3, 4]
Source by xahlee.info #
 
PREVIOUS NEXT
Tagged: #List #Comprehension #generate #list
ADD COMMENT
Topic
Name
5+9 =