I have literally done what they asked (python), what am I missing here?


#1

Ok:

I am working on: https://www.codecademy.com/courses/learn-python/lessons/python-syntax/exercises/update-variables?action=resume_content_item

Where I am asked to create a variable called “annual_rainfall” and update it to the sum of some variables called “september_rainfall” through “december_rainfall” using the “+=” operator. So my submission was:

annual_rainfall = 0
september_rainfall = 10
october_rainfall = 20
november_rainfall = 30
december_rainfall = 40
annual_rainfall += september_rainfall 
annual_rainfall += october_rainfall
annual_rainfall += november_rainfall
annual_rainfall += december_rainfall

What am I missing here? Based on the hint they have given


#2

We’re trying to figure out how much it rained in the past year! Update the annual_rainfall variable to include the values from September to December.

annual_rainfall += september_rainfall 
annual_rainfall += october_rainfall
annual_rainfall += november_rainfall
annual_rainfall += december_rainfall

Could be done in one line.


#3

I think @ghostlovescore is correct. Codecadamy is kinda jiffy when it comes to accuracy.

annual_rainfall += september_rainfall + october_rainfall + november_rainfall + december_rainfall

This answer seemed to work for me.

Also i believe you dont want to set annual_rainfall back to zero.