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.880
from hundreds of MIT courses,
visit MIT OpenCourseWare

00:00:17.880 --> 00:00:18.840
at ocw.mit.edu.

00:00:23.710 --> 00:00:27.790
ANA BELL: This is my
definition, including the method

00:00:27.790 --> 00:00:31.570
to paint the car, so
to change its color.

00:00:31.570 --> 00:00:35.350
And the question says you create
a car with this line here.

00:00:35.350 --> 00:00:37.780
So you're initializing
it with 4 comma 2.

00:00:37.780 --> 00:00:41.050
What's a line of code that
changes the color from whatever

00:00:41.050 --> 00:00:44.600
it initially is to red?

00:00:44.600 --> 00:00:47.540
The first one,
car.paintred, is sort

00:00:47.540 --> 00:00:50.270
of attempting to
do the way that we

00:00:50.270 --> 00:00:51.770
saw in the right
in the slides where

00:00:51.770 --> 00:00:53.930
you calling the class name dot.

00:00:53.930 --> 00:00:55.220
But it's missing the self.

00:00:55.220 --> 00:00:57.290
So we don't know what
object to call it on.

00:00:57.290 --> 00:00:59.720
So that one's out
of the running.

00:00:59.720 --> 00:01:03.440
The second one is closer,
but we have red here as

00:01:03.440 --> 00:01:06.640
a variable as
opposed to a string.

00:01:06.640 --> 00:01:09.040
So that one's not going to work.

00:01:09.040 --> 00:01:11.140
The third one looks good.

00:01:11.140 --> 00:01:14.390
And the fourth
one is just weird.

00:01:14.390 --> 00:01:16.240
I don't think that
one will work.

00:01:16.240 --> 00:01:18.250
It's attempting to
put a value for self.

00:01:18.250 --> 00:01:25.500
But you've already called mycar
dot instead of the class name

00:01:25.500 --> 00:01:26.410
dot.

00:01:26.410 --> 00:01:31.160
So here, this isn't
going to work.

00:01:31.160 --> 00:01:38.162
So since you already called the
object name dot method name,

00:01:38.162 --> 00:01:40.620
you just have to give it the
other parameter that it needs,

00:01:40.620 --> 00:01:42.370
which is the color.

00:01:42.370 --> 00:01:45.497
I think the majority
have gotten it right.