Add readme and final improvements
This commit is contained in:
2
utils.py
2
utils.py
@@ -2,5 +2,5 @@ from tabulate import tabulate
|
||||
|
||||
def format_product_table(product_info, tablefmt="grid"):
|
||||
headers = ["Product Name", "Price", "Discount", "original price", "URL"]
|
||||
table_data = [[info["name"], info["price"], info["discount"] + "%", info["originalPrice"], info["url"]] for info in product_info]
|
||||
table_data = [[info["name"], info["price"], str(info["discount"]) + " %", info["originalPrice"], info["url"]] for info in product_info]
|
||||
return tabulate(table_data, headers=headers, tablefmt=tablefmt)
|
||||
|
||||
Reference in New Issue
Block a user