CSE 2050 - Mod 2

0.0(0)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/24

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:40 AM on 1/30/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

25 Terms

1
New cards

If you use the "yield function within what would otherwise be a function, what does it create?

A generator

2
New cards

What is a public method?

Something that anyone can change

3
New cards

Attributes are

variables created and defined in a method

4
New cards

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

5
New cards

What are the goals of object-oriented programming?

Code reusability, simplicity, and easier visuals

6
New cards

What is a class variable?

A general variable that stays the same for all methods within a class (global)

7
New cards

What is an instance variable?

A variable that changes from method to method (local)

8
New cards

What are objects?

Objects are placeholders of other data types

9
New cards

What is inheritance?

The exchanging of information from a parent class to a/multiple child classes

10
New cards

T/F Inheritance gives all attributes, methods, and behaviors of a child class to a parent class

False, the parent gives to the child

11
New cards

What is method resolution order?

Which class the code checks for the desired method (child FIRST, parent SECOND)

12
New cards

Abstract classes are considered to be ___ for other classes

blueprints

13
New cards

Can abstract classes make objects?

No, they cannot

14
New cards

What is composition?

A way to exchange select information between classes

15
New cards

Polymorphism definition?

Using the same function with the same name but yielding different results

16
New cards

What is operator overloading?

Manually coding something that would otherwise be automatic

ex/ object.__add__(a,b) instead of using +

17
New cards

What is encapsulation?

The packing of data and methods into a class so you can privatize things

18
New cards

How do you make a attribute private?

Two underscores before the name

ex/ self.__baddies = baddie

19
New cards

Can you access a private attributes inside the class? Outside?

Inside: yes but you shouldn’t

Outside: NO, creates attribute error

20
New cards

Purpose of the init method?

To initialize the state of an abject when it is created

21
New cards

Are methods that begin AND end in double underscores private or public?

Public, they’re built into the system and always accessible

22
New cards

If a question says code will “work on any object with an attribute named “___”, what is this an example of?

Polymorphism

23
New cards

What are dunder/magic methods?

Methods that begin and end with __ (double underscore)

24
New cards

What is abstraction?

Knowing the result but not how it works/ innerworkings

25
New cards

What are the four pillars of objects?

Abstraction, Polymorphism, Encapsulation, and Composition