Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # define the Vehicle class
- class Vehicle:
- name = ""
- kind = "car"
- color = ""
- value = 100.00
- def describe(self):
- des_str="%s is a %s %s worth $%.2f" % (self.name,self.color,self.kind,self.value)
- return des_str
- # your code goes here
- car1 = Vehicle()
- car1.name = "Fer"
- car1.color = "red"
- car1.kind = "convertible"
- car1.value = 60000.00
- car2 = Vehicle()
- car2.name = "Jump"
- car2.color = "blue"
- car2.kind = "van"
- car2.value = 10000.00
- # test code
- print(car1.describe())
- print(car2.describe())
Add Comment
Please, Sign In to add comment