Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to subtract up everything in a list python

num = [1,2,3,4]

for x in range(len(num)):
  num[x]-=1 #Same as num[x] = num[x]-1
 
print(num)
#Good luck my future sofwtare devs
 
PREVIOUS NEXT
Tagged: #subtract #list #python
ADD COMMENT
Topic
Name
4+9 =