This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Inventory: | |
def __init__(self, items): | |
self.items = items | |
def show(self): | |
print self.items | |
''' | |
Adds an item to the inventory if it is not full. | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#this function adds an item to the inventory if it is not full | |
def add_item(inventory, new_item): | |
if len(inventory) < 12: | |
inventory.append(new_item) | |
print inventory | |
else: | |
print "Your inventroy is full." | |
#this function removes an item from the inventory | |
def remove_item(inventory, del_item): |