1 00:00:00,790 --> 00:00:03,190 The following content is provided under a Creative 2 00:00:03,190 --> 00:00:04,730 Commons license. 3 00:00:04,730 --> 00:00:07,030 Your support will help MIT OpenCourseWare 4 00:00:07,030 --> 00:00:11,390 continue to offer high quality educational resources for free. 5 00:00:11,390 --> 00:00:13,990 To make a donation, or view additional materials 6 00:00:13,990 --> 00:00:17,880 from hundreds of MIT courses, visit MIT OpenCourseWare 7 00:00:17,880 --> 00:00:18,840 at ocw.mit.edu. 8 00:00:23,710 --> 00:00:27,790 ANA BELL: This is my definition, including the method 9 00:00:27,790 --> 00:00:31,570 to paint the car, so to change its color. 10 00:00:31,570 --> 00:00:35,350 And the question says you create a car with this line here. 11 00:00:35,350 --> 00:00:37,780 So you're initializing it with 4 comma 2. 12 00:00:37,780 --> 00:00:41,050 What's a line of code that changes the color from whatever 13 00:00:41,050 --> 00:00:44,600 it initially is to red? 14 00:00:44,600 --> 00:00:47,540 The first one, car.paintred, is sort 15 00:00:47,540 --> 00:00:50,270 of attempting to do the way that we 16 00:00:50,270 --> 00:00:51,770 saw in the right in the slides where 17 00:00:51,770 --> 00:00:53,930 you calling the class name dot. 18 00:00:53,930 --> 00:00:55,220 But it's missing the self. 19 00:00:55,220 --> 00:00:57,290 So we don't know what object to call it on. 20 00:00:57,290 --> 00:00:59,720 So that one's out of the running. 21 00:00:59,720 --> 00:01:03,440 The second one is closer, but we have red here as 22 00:01:03,440 --> 00:01:06,640 a variable as opposed to a string. 23 00:01:06,640 --> 00:01:09,040 So that one's not going to work. 24 00:01:09,040 --> 00:01:11,140 The third one looks good. 25 00:01:11,140 --> 00:01:14,390 And the fourth one is just weird. 26 00:01:14,390 --> 00:01:16,240 I don't think that one will work. 27 00:01:16,240 --> 00:01:18,250 It's attempting to put a value for self. 28 00:01:18,250 --> 00:01:25,500 But you've already called mycar dot instead of the class name 29 00:01:25,500 --> 00:01:26,410 dot. 30 00:01:26,410 --> 00:01:31,160 So here, this isn't going to work. 31 00:01:31,160 --> 00:01:38,162 So since you already called the object name dot method name, 32 00:01:38,162 --> 00:01:40,620 you just have to give it the other parameter that it needs, 33 00:01:40,620 --> 00:01:42,370 which is the color. 34 00:01:42,370 --> 00:01:45,497 I think the majority have gotten it right.