-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.py
More file actions
21 lines (19 loc) · 856 Bytes
/
Package.py
File metadata and controls
21 lines (19 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class Package:
def __init__(self, id, address, city, state, zip, deadline, weight, notes, status):
self.id = id
self.address = address
self.city = city
self.state = state
self.zip = zip
# delivery time
self.deadline = deadline
self.weight = weight
self.notes = notes
self.status = status
self.delivery_time = None
self.mileage = 0
self.time_left = None
def __str__(self): # overwite print(Package) otherwise it will print object reference
return "Package ID %s, %s, %s, %s, %s, deadline %s, time left %s, delivery time %s, %s, %s, %s,Status %s " % (
self.id, self.address, self.city, self.state, self.zip, self.deadline, self.time_left, self.delivery_time, self.mileage,
self.weight, self.notes, self.status)