Language is Python. I am trying to add 'a' to all of the values in a list 'sumarr'.
Here is my code:
for b in sumarr:
b+=a
Why does this not work? I know I can use list comprehensions like this:
sumarr = [b+a for b in sumarr]
But why does the first method not work?