I’m trying to study for my Python course and I need some help to understand this question.
LAB
ACTIVITY
16.23.1: Ch 9 Program: Online shopping cart (continued) (Python 3)
1 / 29
main.py
Load default template...
class ItemToPurchase:
def __init__(self, item_name= 'none', item_price=0, item_quantity=0, item_description = 'none'):
self.item_name = item_name
self.item_price = item_price
self.item_quantity = item_quantity
self.item_description = item_description
def print_item_cost(self):
string = '{} {} @ ${} = ${}'.format(self.item_name, self.item_quantity, self.item_price, (self.item_quantity
* self.item_price))
cost = self.item_quantity * self.item_price
return string, cost
def print_item_description(self):
string = '{}: {}'.format(self.item_name, self.item_description)
print(string, end=' ')
return string
class ShoppingCart: