- This event has passed.
6:30 PM – Python Object Oriented Programming – Sebastian
April 11, 2023 @ 6:30 pm - 7:30 pm
Today We Did
- Finished library system project
- Began shopping cart OOP
- In case you need anything, feel free to email me at sebastian@ayclogic.com
Homework
- Name your homework APR11_supermarket_hw, please submit by next Monday.
- Homework: The following code exists in our old grocery_shopping_cart file that we want to replace:
if selection == "99": break elif selection in items_inventory.keys(): print(f"You have purchased {items_inventory[selection]} for ${items_price[selection]}") total_cost += items_price[selection] shopping_cart.append(items_inventory[selection]) else: print("Invalid selection, please try again.")
How can we add this to our while loop inside our ShoppingCartApplication class? Remember, all you need to use is:
– self.menu_items dictionary attribute to get item names and prices
– self.menu attribute to help see what each price and name means