def display_products():
    # for x in range(len(catalog)):
    #    print(str(catalog[x].id) + " | "+catalog[x].title)

    print_header("Current catalog")
    for prod in catalog:
        print_product_info(prod)
Пример #2
0
def display_cheaper_products():
    print_header("Cheapest product is")

    cheapest = catalog[0]
    for prod in catalog:
        if (prod.price < cheapest.price):
            cheapest = prod
    print("Cheapest product is:")
    print_product_info(cheapest)
Пример #3
0
def cheapest_product():
    print_header("Print the cheapest product")

    cheapest = catalog[0]
    for prod in catalog:
        if (prod.price < cheapest.price):
            cheapest = prod

    print("Cheapest product is:")
    print_product_info(cheapest)
Пример #4
0
def display_no_stock():
    print_header("Products out of stock")
    for prod in catalog:
        if (prod.stock == 0):
            print_product_info(prod)
Пример #5
0
def display_catalog():
    print_header("Current Catalog")
    for prod in catalog:
        print_product_info(prod)
Пример #6
0
def display_products_equal_zero():
    print_header("Stock == 0")
    for prod in catalog:
        if (prod.stock == 0):
            print_product_info(prod)
Пример #7
0
def display_products():
    print_header("Catalog")
    for prod in catalog:
        print_product_info(prod)
Пример #8
0
def display_outofstock():
    print_header("Your current Out of Stock Products")
    for prod in catalog:
        if (prod.stock == 0):
            print_product_info(prod)