« All Events
6:00 PM-Python OOP- Joshua
July 31, 2025 @ 6:00 pm - 7:00 pm
Today we did
- Practiced using dictionaries in class
- practiced functions with classes
- Went Over our Fruit Homework
Homework:
- Create a new project called :Supermarket
- Create a src folder/directory with the following files
- grocery_item.py
- grocery_store.py
- in grocery_item.py
- Create a class called Grocery_item
- the class takes the following items in its __init__
name, price, frozen_food/
- in grocery_store_main
- transfer/ import your Grovery_store item in a single class
- Hint: To import Grocery Item, you must fall this format
- from <insert_file_name_no_py> import <class_name>
- Create a class called Grocery_Store
- in your __init__ create a empty dictionary called food_items
- In addition three seperate lines, use your Grocery_Item class to create 3 different grocery items and add it to the dictionary (Should be in your init)
- create the add_grocery_item class function .
- Ask for the info about the grocery item
- create an instance of a Grocery_Item
- Put it in the Dictionary