示例#1
0
def cheapest_product_adv():
    print_header(" Cheapest price advance")

    if (len(catalog) < 1):
        print("** Error, empty catalog. Register prods first.")
        return

    cheapest = catalog[0]
    #check if prod is cheaper than cheapest, if it is, then prod is my new cheapest
    for prod in catalog:
        if (prod.price < cheapest.price):
            cheapest = prod

    print_product(cheapest)
    """
示例#2
0
def out_of_stock():
    print_header("Currently Out of Stock")

    for prod in catalog:
        if (prod.stock == 0):
            print_product(prod)
示例#3
0
def print_catalog():
    print_header(" Current Catalog ")

    for prod in catalog:
        print_product(prod)