- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample2.py
More file actions
Latest commit
26 lines (23 loc) · 540 Bytes
/
Copy pathexample2.py
File metadata and controls
26 lines (23 loc) · 540 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# define the Vehicle class
classVehicle:
name=""
kind="car"
color=""
value=100.00
defdescription(self):
desc_str="%s is a %s %s worth $%.2f."% (self.name, self.color, self.kind, self.value)
returndesc_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
printcar1.description()
printcar2.description()