Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Quiz
7. Question 6
Summary

Instruction

Good job! There is just one question left.

In this exercise, we use an OrderedDictionary—a dictionary that keeps an order of its elements asignment. Don't worry, you can access the elements of an ordered dictionary or manipulate them just like you've always done with ordinary dictionaries.

Exercise

Given a dictionary named weight_measurement, print a report like this:

============WEIGHT REPORT============
2018-09-01................67.4 (67.4)
2018-09-02................69.8 ( 2.4)
2018-09-03................68.2 (-1.5)
2018-09-04................66.9 (-1.4)
2018-09-05................67.0 ( 0.2)
2018-09-06................68.0 ( 1.0)
2018-09-07................69.1 ( 1.1)
========================END OF REPORT

Note:

  1. The title and bottom bars should each be 37 characters long.
  2. At the end of each line, you should write the difference between the current value and the previous value inside parentheses. Use the weight value 67.4 for the first row.

Stuck? Here's a hint!

You can use:

for key, value in weight_measurement.items():

Just like you usually do 🙂

If that wasn't your problem, consider reviewing string formatting for this task—take a look at Part 3.