WEBVTT

00:00:00.790 --> 00:00:03.190
The following content is
provided under a Creative

00:00:03.190 --> 00:00:04.730
Commons license.

00:00:04.730 --> 00:00:07.030
Your support will help
MIT OpenCourseWare

00:00:07.030 --> 00:00:11.390
continue to offer high quality
educational resources for free.

00:00:11.390 --> 00:00:13.990
To make a donation or
view additional materials

00:00:13.990 --> 00:00:17.520
from hundreds of MIT courses,
visit MIT OpenCourseWare

00:00:17.520 --> 00:00:18.590
at ocw.mit.edu.

00:00:24.220 --> 00:00:26.320
PROFESSOR: So for
this last class

00:00:26.320 --> 00:00:30.920
exercise we have
this following code.

00:00:30.920 --> 00:00:35.750
So we have 46 for USA
gold, 27 for UK gold,

00:00:35.750 --> 00:00:38.140
1 for Romanian gold.

00:00:38.140 --> 00:00:41.830
We make this variable,
here, Total Gold,

00:00:41.830 --> 00:00:46.060
to be the sum of those
three which I believe is 74.

00:00:46.060 --> 00:00:48.240
Then we're going to
print total gold.

00:00:48.240 --> 00:00:49.007
OK?

00:00:49.007 --> 00:00:51.340
Then we're going to increase
the value for Romanian gold

00:00:51.340 --> 00:00:53.200
and we're going
to print it again.

00:00:53.200 --> 00:00:58.330
So as always, you can just
copy this, pop it into Python,

00:00:58.330 --> 00:01:02.080
and run it to test yourself,
but you should do it just

00:01:02.080 --> 00:01:03.650
in your mind first.

00:01:03.650 --> 00:01:06.670
So notice it print
74 in 74, and that's

00:01:06.670 --> 00:01:08.470
because we never
told the program

00:01:08.470 --> 00:01:12.400
to calculate the new total.

00:01:12.400 --> 00:01:18.020
So we only calculated the
total, way up here on line 5.

00:01:18.020 --> 00:01:22.790
If we calculated the
total again down here,

00:01:22.790 --> 00:01:28.340
then it would be 74.75 So
let's look at the answers,

00:01:28.340 --> 00:01:31.340
hopefully you guys got that.

00:01:31.340 --> 00:01:34.200
Perfect, majority
are good to go.

00:01:34.200 --> 00:01:37.340
If you didn't get that
please try to review it,

00:01:37.340 --> 00:01:39.620
review why it didn't work.