コード例 #1
0
 def fill_inventory(self):
     """Method will fill SodaMachine's cans list with certain amounts of each can when called."""
     for index in range(10):
         self.inventory.append(cans.Cola())
     for index in range(10):
         self.inventory.append(cans.OrangeSoda())
     for index in range(10):
         self.inventory.append(cans.RootBeer())
コード例 #2
0
 def fill_inventory(self):
     """Method will fill SodaMachine's cans list with certain amounts of each can when called. NOW IS CORRECTLY CALLED AT SODAMACHINE INSTANTIATION"""
     for index in range(10):
         self.inventory.append(cans.Cola())
     for index in range(10):
         self.inventory.append(cans.OrangeSoda())
     for index in range(10):
         self.inventory.append(cans.RootBeer())