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