« All Events
5 PM – Python OOP – Juan
November 13, 2023 @ 5:00 pm - 6:00 pm
Today We Did
- Continued working on the Supermarket System.
- Created a class for grocery items.
- Added an
in_stock
attribute, to determine whether items can be purchased or not
Homework
- Name your folder Nov20_Supermarket_HW and do:
- Finish the
restock()
function for the GroceryItem
class.
This function should set the in_stock
attribute to True
- Call the
restock()
function whenever an item that’s out of stock gets purchased in main.py
- Combine similar items together when they’re displayed when
choice == "5"
. - Display the total cost of ALL items after user checks out, when
choice == "4"