MCPcopy Index your code
hub / github.com/faif/python-patterns / get_product_information

Method get_product_information

patterns/structural/3-tier.py:49–59  ·  view source on GitHub ↗
(self, product: str)

Source from the content-addressed store, hash-verified

47 print("")
48
49 def get_product_information(self, product: str) -> None:
50 product_info = self.business_logic.product_information(product)
51 if product_info:
52 print("PRODUCT INFORMATION:")
53 print(
54 f"Name: {product.title()}, "
55 + f"Price: {product_info.get('price', 0):.2f}, "
56 + f"Quantity: {product_info.get('quantity', 0):}"
57 )
58 else:
59 print(f"That product '{product}' does not exist in the records")
60
61
62def main():

Callers

nothing calls this directly

Calls 2

product_informationMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected