Loading Events

« All Events

  • This event has passed.

7 PM – Python OOP – Joshua (Gamas Sub)

October 16 @ 7:00 pm - 8:00 pm
Today We Did
  1. We created oct_16_grocery_v3.py and grocery_item.py.
  2. We started utilize GroceryItem class to replace the 2 dictionaries from grocery_v2.py.
  3. Now it is using grocery_dictionary to get the item name and item price.
Homework
  1. Change the code inside oct_16_grocery_v3.py so it knows how to “add” a new grocery item into the grocery_dictionary properly.
    1. You need to change the code below so it will add a new GroceryItem object into grocery_dictionary
      1. elif selection == "add":
            food_name = input("Enter food name: ")
            food_price = int(input("Enter food price: "))
            id= input("Enter food id: ")
            food_id[id] = food_name
            catalog[food_name]=food_price

Details

  • Date: October 16
  • Time:
    7:00 pm - 8:00 pm