Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Store():
- def __init__(self):
- self.available_items = []
- self.customer_list = []
- class Inventory():
- def __init__(self, name, stock, price):
- self.name = name
- self.stock = stock
- self.price = price
- def __str__(self):
- return 'Name: {0}, Stock: {1}, Price: {2}'.format(self.name, self.stock, self.price)
- # Store name is listed along with its database of items
- amazon = Store()
- amazon.available_items = {
- 111: Inventory('Ice Cubes', 10, 7.99),
- 121: Inventory('Butter', 8, 4.99),
- 131: Inventory('Radio', 70, 17.99),
- 141: Inventory('Underwear', 15, 3.99),
- 151: Inventory('Coffee', 17, 2.99)
- }
- print(amazon.available_items[111])
- for items in amazon.available_items:
- print items
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement