Transcript

the following content is provided under a Creative Commons license your support will help MIT open courseware continue to offer highquality educational resources for free to make a donation or view additional materials from hundreds of MIT courses visit MIT open courseware at ocw.mit.edu this is my definition including the method to paint the car so to change it color and the question says you create a car with this line here so you're initializing it with four comma 2 what's a line of code that changes the color from uh whatever initially is to Red the first one car. paint red is sort of attempting to do the the way that we saw on the right in the slides where you're calling the class name dot but it's missing the self so we don't know what object to call it on so that one's out of the running the second second one is closer but we have red here as a variable as opposed to a string so that one's not not going to work the third one looks good and the fourth one is just weird I don't think that one will work it's attempting to put a value for self but you've already called my car dot instead of the um instead of the uh class class name dot so here um this isn't going to work so since you already called um the object name dot method name you just have to give it the other parameter that it needs which is the color okay and I think the majority have gotten it right