- This event has passed.
7 PM – Python OOP – Sebastian
February 28 @ 7:00 pm - 8:00 pm
Today We Did
- Began Monster Inheritance project
- Created basic MonsterSystem class
- AYC Logic’s observed holidays: https://www.ayclogic.com/observed-holidays/
- In case you need anything, feel free to email me at sebastian@ayclogic.com
Homework
- Please come to class with the following written down, ready to explain to me (you don’t have to submit this anywhere, but please have it ready before class)
- How do you add to a dictionary? For example, if I have the following code, how would I map the key “cat” to the value “Momo”?
pet_to_name = {"dog": "Spike"}
- How do I make an instance of a class (an object)? For example, if I had the following code, how could I make an instance of the Animal class?
class Animal: def __init__(self, name): self.name = name def get_info(self): return self.name
- How do I call an object’s method? After you made an instance of the Animal class (above), show me how we can call the get_info() method, and print its return value.
- How do you add to a dictionary? For example, if I have the following code, how would I map the key “cat” to the value “Momo”?