Why do I get an attribute error with my class?
<p><em><strong>EDIT BELOW!</em></strong></p>

<p>Here is my retail_item class:</p>

<pre><code>#RetailItem Class

class RetailItem:
    def __init__(self, desc, inventory, price):
        self.__desc=desc
        self.__inventory=inventory
        self.__price=price

#mutators
    def set_desc (self, desc):
         self.__desc=desc
    def set_inventory (self, inventory):
         self.__inventory=inventory
    def set_price (self, price):
         self.__price = price

#accessors
    def get_desc(self):
        return self.__desc
    def get_inventory(self):
        return self.__inventory
    def get_price(self):
        return self.__price

    def __str__(self):
        return 'Item Description:' + self.__desc, \
               '\tNumber of Units:' + self.__inventory, \
               '\tPrice: $' + self.__price
</code></pre>

<p>And my cash_register class:</p>

<pre><code>#CashRegister Class

class CashRegister:
    def __init__(self, purchase, total, show, clear):
        self.__purchase=purchase
        self.__total=total
        self.__show=show
        self.__clear=clear

#mutators
    def purchase_item(self, purchase):
        self.__purchase=purchase
    def get_total(self, total):
        self.__total=total
    def show_item(self, show):
        self.__show=show
    def clear(self, clear):
        self.__clear=clear

#accessors
    def acc_purchase(self):
        return self.__purchase
    def acc_total(self):
        return self.__total
    def acc_show(self):
        return self.__show
    def acc_clear(self):
        return self.__clear
</code></pre>

<p>And finally my program:</p>

<pre><code>import retail_item
import cash_register

SHOW = 1
PURCHASE = 2
CART = 3
TOTAL = 4
EMPTY = 5
QUIT = 6

def main():
    mylist = make_list()
    #mycr = cash_register.CashRegister(mylist)

    choice = 0

    # Process menu selections until user quits program.
    while choice != QUIT:
        # Get the user's menu choice.
        choice = get_menu_choice()
        # Proces the choice.
        if choice == SHOW:
            show_items(mylist)
        elif choice == PURCHASE:
            purchase_item(mylist)
        elif choice == TOTAL:
            get_total(mylist)
        elif choice == EMPTY:
            clear(mylist)

def make_list():
    item_list = {}

    desc = 'Jacket'
    inventory = 12
    price = 59.95
    entry = retail_item.RetailItem(desc, inventory, price)
    item_list[desc]=entry

    desc = 'Jeans'
    inventory = 40
    price = 34.95
    entry = retail_item.RetailItem(desc, inventory, price)
    item_list[desc]=entry

    desc = 'Shirt'
    inventory = 20
    price = 24.95
    entry = retail_item.RetailItem(desc, inventory, price)
    item_list[desc]=entry

    return item_list

# The get_menu_choice function displays the menu and gets
#   a validated choice from the user.
def get_menu_choice():
    print()
    print('CASH REGISTER MENU')
    print('-------------------------')
    print('1. Show Retial Items')
    print('2. Purchase Item(s)')
    print('3. Show Current Shopping Cart')
    print('4. Show Total of Items Purchased')
    print('5. Empty Your Shopping Cart')
    print('6. Quit the program')
    print()

    # Get the user's choice.
    choice = int(input('Enter your choice: '))

    # Validate the choice.
    while choice &lt; SHOW or choice &gt; QUIT:
        choice = int(input('Enter a valid choice: '))

    # Return the user's choice.
    return choice

def show_items(mylist):
    print('\t\tDescription\t\tUnits in Inventory\t\tPrice')
    print('--------------------------------------------------------------------------------')
    x=1
    for item in mylist:
        print('Item #', x, '\t\t', item.get_desc(), '\t\t\t\t', item.get_inventory(), '\t\t\t$', format(item.get_price(), ',.2f'),sep='')
        print()
        x+=1

def purchase_item(mylist):
    desc = input('Enter the item you wish to purchase: ')
    if desc in mylist:
        amount=int(input('How many would you like to buy: '))
        if mylist[units]&gt;0:
            mylist[units]-=amount
        elif (units-amount&lt;0):
            mylist[units]=0
        else:
            mylist[units] = 0

    entry=cash_register.CashRegister(desc, units,)
    mylist[desc]=entry
    print()


def get_total(mylist):
    print()

def clear(mylist):
    print(mylist)
    mylist.clear()
    print(mylist)
main()            
</code></pre>

<p>So my question is, how to I update only one object of a class?
And how do I call on the cash_register class?</p>

<p>Here are the instructions for the assignment, if that helps:</p>

<p>This exercise assumes that you have created the RetailItem class for Programming
Exercise 5. Create a CashRegister class that can be used with the RetailItem class. The
CashRegister class should be able to internally keep a list of RetailItem objects. The
class should have the following methods:
• A method named purchase_item that accepts a RetailItem object as an argument.
Each time the purchase_item method is called, the RetailItem object that is passed as
an argument should be added to the list.
• A method named get_total that returns the total price of all the RetailItem objects
stored in the CashRegister object’s internal list.
• A method named show_items that displays data about the RetailItem objects stored
in the CashRegister object’s internal list.
• A method named clear that should clear the CashRegister object’s internal list.
Demonstrate the CashRegister class in a program that allows the user to select several
items for purchase. When the user is ready to check out, the program should display a list
of all the items he or she has selected for purchase, as well as the total price.</p>

<p><em><strong>EDIT:</em></strong> Here's my somewhat final code. I know it's not pretty, and I apologize for the lack of comments. I would still like some feedback even though I'll be submitting it shortly (for my own betterment and for job opportunities!) Here it is:</p>

<pre><code>import retail_item
import cash_register

SHOW = 1
PURCHASE = 2
TOTAL = 3
EMPTY = 4
QUIT = 5

def main():
    #set all variables to zero
    lister = []
    inv=[]
    cost=[]
    desc=''
    inventory=0
    price=0
    total=0
    purchase=0
    #setting variable for each class
    cash=cash_register.CashRegister(purchase, total, lister, inv, cost)
    retail=retail_item.RetailItem(desc, inventory, price)

    #classes
    desc = 'Jacket'
    inventory = 12
    price = 59.95
    #setting classes
    retail.set_desc(desc)
    retail.set_inventory(inventory)
    retail.set_price(price)
    #Adding to cart
    cash.purchase_item(retail.get_desc(), lister)
    cash.purchase_item(retail.get_inventory(), inv)
    cash.purchase_item(retail.get_price(), cost)

    desc = 'Jeans'
    inventory = 40
    price = 34.95
    retail.set_desc(desc)
    retail.set_inventory(inventory)
    retail.set_price(price)
    cash.purchase_item(retail.get_desc(), lister)
    cash.purchase_item(retail.get_inventory(), inv)
    cash.purchase_item(retail.get_price(), cost)

    desc = 'Shirt'
    inventory = 20
    price = 24.95
    retail.set_desc(desc)
    retail.set_inventory(inventory)
    retail.set_price(price)
    cash.purchase_item(retail.get_desc(), lister)
    cash.purchase_item(retail.get_inventory(), inv)
    cash.purchase_item(retail.get_price(), cost)

    choice = 0

    # Process menu selections until user quits program.
    while choice != QUIT:
        # Get the user's menu choice.
        choice = get_menu_choice()
        # Proces the choice.
        if choice == SHOW:
            show_items(cash, retail, lister, inv, cost)
        elif choice == PURCHASE:
            purchase_item(cash, retail, lister, inv, cost)
        elif choice == TOTAL:
            get_total(cash, retail, lister)
        elif choice == EMPTY:
            price=0
            cash.set_total(price)
            clear(cash, lister)


# The get_menu_choice function displays the menu and gets
#   a validated choice from the user.
def get_menu_choice():
    print()
    print('CASH REGISTER MENU')
    print('-------------------------')
    print('1. Show Retail Items')
    print('2. Purchase Item(s)')
    print('3. Show Total of Items Purchased')
    print('4. Empty Your Shopping Cart')
    print('5. Quit the program')
    print()

    # Get the user's choice.
    choice = int(input('Enter your choice: '))

    # Validate the choice.
    while choice &lt; SHOW or choice &gt; QUIT:
        choice = int(input('Please enter a valid choice: '))

    # Return the user's choice.
    return choice

def show_items(cash, retail, lister, inv, cost):
    print('\t\tDescription\t\tUnits in Inventory\t\tPrice')
    print('--------------------------------------------------------------------------------')
    cash.show_item(lister, inv, cost)


def purchase_item(cash, retail, lister, inv, cost):

    JACKET=1
    JEANS=2
    SHIRT=3
    QUIT=4
    choice=0

    print()
    print('WHICH WOULD YOU LIKE TO BUY')
    print('-------------------------')
    print('1. Jacket')
    print('2. Jeans')
    print('3. Shirt')
    print('4. Quit')
    print()

    print('Choose as many as you like. Press 4 then ENTER to quit.')
    while choice != QUIT:
        # Get the user's menu choice.
        choice = int(input('Which would you like to buy: '))
        if choice &lt; JACKET or choice &gt; QUIT:
            choice = int(input('Please enter a valid choice: '))

        while choice != QUIT:
            # Proces the choice.
            if choice == JACKET:
                desc = 'Jacket'
                inventory = 12
                price = 59.95
                retail.set_desc(desc)
                retail.set_inventory(inventory)
                retail.set_price(price)
                cash.purchase_item(retail.get_desc(), lister)
                cash.purchase_item(retail.get_inventory(), inv)
                cash.purchase_item(retail.get_price(), cost)
                cash.set_total(price)
                break
            elif choice == JEANS:
                desc = 'Jeans'
                inventory = 40
                price = 34.95
                retail.set_desc(desc)
                retail.set_inventory(inventory)
                retail.set_price(price)
                cash.purchase_item(retail.get_desc(), lister)
                cash.purchase_item(retail.get_inventory(), inv)
                cash.purchase_item(retail.get_price(), cost)
                cash.set_total(price)
                break
            elif choice == SHIRT:
                desc = 'Shirt'
                inventory = 20
                price = 24.95
                retail.set_desc(desc)
                retail.set_inventory(inventory)
                retail.set_price(price)
                cash.purchase_item(retail.get_desc(), lister)
                cash.purchase_item(retail.get_inventory(), inv)
                cash.purchase_item(retail.get_price(), cost)
                cash.set_total(price)
                break

    print()


def get_total(cash, retail, lister):    
    print()
    cash.show_items(cash.get_list(lister))
    print('Your total is: $', format(cash.cost_total(),',.2f'))

def clear(cash, lister):
    print('Shopping cart emptied.')
    lister=lister.clear()
    price=0
    cash.set_total(price)

    return lister
main()
</code></pre>

<p>RetailItem Class:</p>

<pre><code>class RetailItem:
    def __init__(self, desc, inventory, price):
        self.__desc=desc
        self.__inventory=inventory
        self.__price=price

#mutators
    def set_desc (self, desc):
        self.__desc=desc
    def set_inventory (self, inventory):
        self.__inventory=inventory
    def set_price (self, price):
        self.__price = price

#accessors
    def get_desc(self):
        return self.__desc
    def get_inventory(self):
        return self.__inventory
    def get_price(self):
        return self.__price

    def __str__(self):
        return 'Item Description:' + self.__desc, \
              '\tNumber of Units:' + self.__inventory, \
              '\tPrice: $' + self.__price
</code></pre>

<p>And again, lastly my CashRegister Class:</p>

<pre><code>#CashRegister Class

class CashRegister:
    def __init__(self, purchase, total, lister, inv, cost):
        self.__purchase=purchase
        self.__total=total
        self.__lister=[]
        self.__inv=[]
        self.__cost=[]


#mutators
    def purchase_item(self, purchase, lister):
        self.__purchase=purchase
        lister.append(purchase)
        return lister

    def set_total(self, price):
        self.__total+=price


    def show_item(self, lister, inventory, price):
        i=0
        while i&lt;len(lister):
            s=('Item # %i\t%s\t\t\t\t%i\t\t\t%4.2f') % ((i+1),lister[i],inventory[i],price[i])
            s = s.strip(' \t\n\r')
            print(s)
            i+=1

    def show_items(self, lister):
        i=0
        print('You have purchased the following items')
        while i&lt;len(lister):
            print(lister[i])
            i+=1

    def clear(self, lister):
        i=0
        while i&lt;len(lister):
            del lister[i]
            i+=1
            return lister

    def get_list(self, lister):
        return lister
#accessors
    def acc_purchase(self):
        return self.__purchase
    def cost_total(self):
        return self.__total
    def acc_show(self):
        return self.__show
    def acc_clear(self):
        return self.__clear
</code></pre>

<p>Thanks again guys! I used this site often, and though I didn't use much of what y'all gave me this time, you're still awesome!</p>
