Why can’t I write the whole update of the variable in one line? Like this- annual_rainfall+=september_rainfall+=october_rainfalll+=november_rainfall ,ect.
When adding multiple values together, you need to use only a single plus sign (
+). When assigning a variable a new value, you use a
+= assignment operator (which is the same as
foo = foo + ...). So, instead of assigning every variable a new value try assigning
october_rainfall, and so on.