1/24
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
If you use the "yield function within what would otherwise be a function, what does it create?
A generator
What is a public method?
Something that anyone can change
Attributes are
variables created and defined in a method
T/F Inheritance has a “has a” relationship
False, it has a “is a” relationship because EVERYTHING is inherited.
ex/ A cat IS A animal, so cat would inherit everything from the animal class
What are the goals of object-oriented programming?
Code reusability, simplicity, and easier visuals
What is a class variable?
A general variable that stays the same for all methods within a class (global)
What is an instance variable?
A variable that changes from method to method (local)
What are objects?
Objects are placeholders of other data types
What is inheritance?
The exchanging of information from a parent class to a/multiple child classes
T/F Inheritance gives all attributes, methods, and behaviors of a child class to a parent class
False, the parent gives to the child
What is method resolution order?
Which class the code checks for the desired method (child FIRST, parent SECOND)
Abstract classes are considered to be ___ for other classes
blueprints
Can abstract classes make objects?
No, they cannot
What is composition?
A way to exchange select information between classes
Polymorphism definition?
Using the same function with the same name but yielding different results
What is operator overloading?
Manually coding something that would otherwise be automatic
ex/ object.__add__(a,b) instead of using +
What is encapsulation?
The packing of data and methods into a class so you can privatize things
How do you make a attribute private?
Two underscores before the name
ex/ self.__baddies = baddie
Can you access a private attributes inside the class? Outside?
Inside: yes but you shouldn’t
Outside: NO, creates attribute error
Purpose of the init method?
To initialize the state of an abject when it is created
Are methods that begin AND end in double underscores private or public?
Public, they’re built into the system and always accessible
If a question says code will “work on any object with an attribute named “___”, what is this an example of?
Polymorphism
What are dunder/magic methods?
Methods that begin and end with __ (double underscore)
What is abstraction?
Knowing the result but not how it works/ innerworkings
What are the four pillars of objects?
Abstraction, Polymorphism, Encapsulation, and Composition