Skip to content

Commit 139cd3c

Browse files
committed
Modified print to use str.format() instead of % replacement.
1 parent 02a45af commit 139cd3c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

3-tier.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ def get_product_information(self, product):
3737
product_info = self.business_logic.product_information(product)
3838
if product_info is not None:
3939
print('PRODUCT INFORMATION:')
40-
print('Name: %s, Price: %.2f, Quantity: %d\n' % \
41-
(product.title(), product_info.get('price', 0), \
42-
product_info.get('quantity', 0)))
40+
print('Name: {:.s}, Price: {:.2f}, Quantity: {:.d}'.format(
41+
product.title(), product_info.get('price', 0),
42+
product_info.get('quantity', 0))
4343
else:
4444
print('That product "%s" does not exist in the records' % product)
4545

0 commit comments

Comments
 (0)