Add readme and final improvements

This commit is contained in:
2024-01-30 20:36:32 +01:00
parent 849a076b51
commit e8a4b83843
4 changed files with 25 additions and 4 deletions

View File

@@ -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)