Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to use enumerate instead of range and len

using enumerate instead of range or len
a = [f(n) for n, _ in enumerate(L)]

using range and len
a = [f(n) for n in range(len(L))]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #enumerate #range #len
ADD COMMENT
Topic
Name
9+7 =