Skip to content

Commit 4050238

Browse files
committed
Fixed formatting error in get_product_information. Got rid of a comparison to None.
1 parent 139cd3c commit 4050238

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

3-tier.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ def get_product_list(self):
3535

3636
def get_product_information(self, product):
3737
product_info = self.business_logic.product_information(product)
38-
if product_info is not None:
38+
if product_info:
3939
print('PRODUCT INFORMATION:')
40-
print('Name: {:.s}, Price: {:.2f}, Quantity: {:.d}'.format(
40+
print('Name: {0}, Price: {1:.2f}, Quantity: {2:}'.format(
4141
product.title(), product_info.get('price', 0),
42-
product_info.get('quantity', 0))
42+
product_info.get('quantity', 0)))
4343
else:
44-
print('That product "%s" does not exist in the records' % product)
44+
print('That product "{0}" does not exist in the records'.format(product))
4545

4646

4747
if __name__ == '__main__':

0 commit comments

Comments
 (0)