Guest User

Untitled

a guest
Dec 18th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. # define the Vehicle class
  2. class Vehicle:
  3. name = ""
  4. kind = "car"
  5. color = ""
  6. value = 100.00
  7.  
  8. def describe(self):
  9. des_str="%s is a %s %s worth $%.2f" % (self.name,self.color,self.kind,self.value)
  10. return des_str
  11.  
  12. # your code goes here
  13. car1 = Vehicle()
  14. car1.name = "Fer"
  15. car1.color = "red"
  16. car1.kind = "convertible"
  17. car1.value = 60000.00
  18.  
  19. car2 = Vehicle()
  20. car2.name = "Jump"
  21. car2.color = "blue"
  22. car2.kind = "van"
  23. car2.value = 10000.00
  24.  
  25. # test code
  26. print(car1.describe())
  27. print(car2.describe())
Add Comment
Please, Sign In to add comment