#define the Vehicle class class Vehicle: name = “” kind = “car” color = “” value = 100.00 #class function named description #we define a variable named desc_str and use #string formatting inside the string def description(self): desc_str = “%s is a %s %s worth $%.2f.” % (self.name, self.color, self.kind, self.value) return desc_str #instantiate two …
Tag Archives: Object
Object Oriented Analysis
The Person class includes Instructor and Student Objects. Notice the Inherited properties (Name, Address and Date of Birth). Other properties are specific to each object like Office Location for the Instructor object and GPA for the Student object.