We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 139cd3c commit 4050238Copy full SHA for 4050238
3-tier.py
@@ -35,13 +35,13 @@ def get_product_list(self):
35
36
def get_product_information(self, product):
37
product_info = self.business_logic.product_information(product)
38
- if product_info is not None:
+ if product_info:
39
print('PRODUCT INFORMATION:')
40
- print('Name: {:.s}, Price: {:.2f}, Quantity: {:.d}'.format(
+ print('Name: {0}, Price: {1:.2f}, Quantity: {2:}'.format(
41
product.title(), product_info.get('price', 0),
42
- product_info.get('quantity', 0))
+ product_info.get('quantity', 0)))
43
else:
44
- print('That product "%s" does not exist in the records' % product)
+ print('That product "{0}" does not exist in the records'.format(product))
45
46
47
if __name__ == '__main__':
0 commit comments