Exemplo n.º 1
0
def make_list():
    item_list = []
    print("Enter data for items:")
    for count in range(1, 4):
        print("Item", str(count), ":")
        description = input("Enter the description: ")
        units = input("Enter the units: ")
        price = float(input("Enter the price: $"))
        item_call = HW1.RetailItem(description, units, price)
        item_list.append(item_call)
    return item_list
Exemplo n.º 2
0
def make_list2():
    item_list3 = []
    item1 = ["Jacket", "12", 59.95]
    item2 = ["Designer Jeans", 40, 34.95]
    item3 = ["Shirt", 20, 24.95]
    item_list2 = [item1, item2, item3]
    count2 = 0
    print("Here is data:")
    for rotation in range(1, 4):
        description = item_list2[count2][0]
        units = item_list2[count2][1]
        price = float(item_list2[count2][2])
        count2 += 1
        item_call = HW1.RetailItem(description, units, price)
        item_list3.append(item_call)
    return item_list3