Answers for "how to add to an exsiting value of an index in a list"

0

how to add to an exsiting value of an index in a list

foo = [1, 2, 3, 4, 5]
foo[3] = foo[3] + 4     
print(foo)            # [1, 2, 3, 8, 5]
Posted by: Guest on April-25-2022

Code answers related to "how to add to an exsiting value of an index in a list"

Python Answers by Framework

Browse Popular Code Answers by Language