-
Class Definition
Which of the following is a good and valid definition for a class representing a car?
-
Class Instance
Using the class definition below, which line creates a new Car object with 4 wheels and 2 doors?
class Car(object):
-
Methods
Which of the following methods changes the color of the car, based on the definition below?
class Car(object):
-
Method Call
You create a car with
mycar = Car(4, 2)
. Which is a line of code to change the color of mycar to “red”?class Car(object):
-
Special Methods
With the code below, what does the line
print(mycar == yourcar)
print?class Car(object):
In-Class Questions and Video Solutions
Lecture 8
Instructors: | |
Course Number: |
|
Departments: | |
As Taught In: | Fall 2016 |
Level: |
Undergraduate
|
Learning Resource Types
assignment
Problem Sets
notes
Lecture Notes
theaters
Lecture Videos
assignment_turned_in
Programming Assignments with Examples