18.6. What’s the average PM 2.5 pollution?

This time, we take every PM 2.5 value and add them all together, and we also increment a count for each value, so we can compute an average.

This section uses the same data file that we have been using, but if you want to see all of the data click on the Show button below. Once it appears, you can hide it again by clicking on the Hide button.

Now, replace the lines that start with # below to write the code to get the average PM 10 value:

The following program prints the maximum PM 2.5 pollution found, but the code is mixed up. Drag the blocks of statements from the left column to the right column and put them in the right order. Then click on <i>Check Me</i> to see if you are right. You will be told if any of the lines are in the wrong order or have the wrong indention.

Note

Discuss topics in this section with classmates.

Show Comments
You have attempted of activities on this page