American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

6:00 PM-Python OOP- Joshua

July 31 @ 6:00 pm - 7:00 pm

Today we did

  • Practiced using dictionaries in class
  • practiced functions with classes
  • Went Over our Fruit Homework

 

Homework:

  1. Create a new project called :Supermarket
  2. Create a src folder/directory with the following files
    1. grocery_item.py
    2. grocery_store.py
  3. in grocery_item.py
    1. Create a class called Grocery_item
      1. the class takes the following items  in its __init__
      2. name, price, frozen_food/
  4. in grocery_store_main
    1. transfer/ import your Grovery_store item in a single class
      1. Hint: To import Grocery Item, you must fall this format
      2. from <insert_file_name_no_py> import <class_name>
    2. Create a class called Grocery_Store
      1. in your __init__ create a empty dictionary  called food_items
      2. 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)
      3. create the add_grocery_item class function .
        1. Ask for the info about the grocery item
        2. create an instance of a Grocery_Item
        3. Put it in the Dictionary

Details

Date:
July 31
Time:
6:00 pm - 7:00 pm