« All Events
5 PM – Python OOP – Bill
April 19, 2022 @ 5:00 pm - 6:00 pm
Today We:
- Learned about how to create a class or custom data type
- Created a GroceryItem class with the attributes: name, price, is_frozen, brand
- Learned how to create a variable that uses our Grocery Item data type
- Learned about the __init__ function/method
- Learned how to access the attributes of the variable
- Learned about what self means
- Learned about how to add attributes and added another atribute: is_dairy
- Learned how to make and call custom methods inside the class
Your HW:
- Create a new file called April_19_ClassesHW
- Follow the book along pages 158 – 161 and copy the code