Python: Adding an entry?
Question: I'm trying to write a program that asks a user to enter a product name, the
price, and quantity. From there, all the info will be added to a table
(dictionary?) Also, an ID number must be assigned to all new items created.
I'm confused about the ID number segment.

    
    
    items = {}
    
    product = str(input("Enter the name of a product: "))
    price = int(input("Enter a price: "))
    quantity = int(input("Enter a quantity: "))
    
    #Assign unique ID number.
    

I'm trying to get the result below as an example:

    
    
    ID#70271, shoes. 7 available, at $77.00
    


Answer: You could use [uuid4](http://docs.python.org/2/library/uuid.html#uuid.uuid4)
to create the unique id

    
    
    >>> from uuid import uuid4
    >>> uuid4().clock_seq
    7972L
    >>> uuid4().clock_seq
    11807L
    >>> uuid4().clock_seq
    15487L
    

