-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvehicle.py
30 lines (25 loc) · 1.02 KB
/
vehicle.py
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
27
28
29
30
class owner(object):
def __init__(self, name, sex, age, phone):
self.name = name
self.sex = sex
self.age = age
self.phone = phone
def __str__(self):
string = ("OWNER>>""Name:"+str(self.name)+","+"Sex:"+str(self.sex))
string += (","+"Age:"+str(self.age)+","+"Phone:"+str(self.phone))
return string
class vehicle(owner):
def __init__(self, idnum, brand, model, color, entryTime, name, sex, age, phone):
self.idnum = idnum
self.color = color
self.brand = brand
self.model = model
self.entryTime = entryTime
self.exitTime = None
owner.__init__(self, name, sex, age, phone)
def __str__(self):
string = ("VEHICLE>>"+"Idnum:"+str(self.idnum)+","+"Color:"+str(self.color))
string += (","+"Brand:"+str(self.brand)+","+"Model:"+str(self.model))
string += (","+"EntryTime:"+str(self.entryTime)+","+"ExitTime:"+str(self.exitTime))
print super(vehicle,self).__str__()
return string