16 lines
511 B
Python
16 lines
511 B
Python
|
class TradeHub:
|
||
|
'Contains items to sell'
|
||
|
def __init__(self, name):
|
||
|
self.name = name
|
||
|
self.items = {}
|
||
|
def addItems(self, items):
|
||
|
self.items = items
|
||
|
def getItems(self):
|
||
|
return self.items
|
||
|
def printItems(self):
|
||
|
print(f"{'Name' : <15}{'- - - - - | - - - - -' : ^10}{'Cost' : >6}")
|
||
|
print()
|
||
|
for item in self.items.values():
|
||
|
print(f"{item.getName() : <15}{'* * * * * | * * * * *' : ^10}{str(item.getPrice()) : >5}")
|
||
|
print()
|