Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

add a constant to a list python

>>> L = [1]*5
>>> [x+1 for x in L]
[2, 2, 2, 2, 2]
>>>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #constant #list #python
ADD COMMENT
Topic
Name
7+7 =