American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

6 PM – Python OOP – Bill

August 20, 2022 @ 6:00 pm - 7:00 pm

Today We:
  1. Practiced more with Classes
  2. Created a Dog Class
  3. Created a give_treat method for it
  4. Learned how to create a list of class instances (list of dogs)
  5. Learned how to loop through list of class instances
Your HW:
  1. Create a new file called “Aug_20_PizzaClassHW”
  2. Create a pizza class with 2 attributes: dough and sauce
  3. Give it a default attribute (not a parameter in the init method) called toppings which is an empty list
  4. Create a add_topping method with 1 parameter: topping_to_add and add that topping to the toppings atribute list
  5. Create a describe pizza method that also loops through the toppings attribute list

Details

Date:
August 20, 2022
Time:
6:00 pm - 7:00 pm
Verified by MonsterInsights