stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Python Lesson 3 - Recap Flashcards | StudBud
Explore
/
Python Lesson 3 - Recap
Python Lesson 3 - Recap
10 terms
·
StudBud Administration
·
4 plays
Imported from external platform
Flashcards
10 cards
F
Practice quiz
P
Host live
L
Questions
10
Answers
1
What method is always executed when classes are initialized?
__create__()
__new__()
__init__()
__start__()
2
The first argument of a method (typically self) is used to refer to the class itself.
True
False
3
You define a class in Python by starting with the keyword "class".
True
False
4
What is printed after this code is run?
car.describe()
This is a Vehicle with 4 wheels.
This is a Toyota with 0 wheels.
This is a Toyota with 4 wheels.
5
What is NOT one of the main concepts of OOP?
Encapsulation
Polymorphism
Inheritance
Compilation
6
What number is printed after this code is run?
50
10
15
Nothing, it returns an error
7
What is the purpose of abstraction in object-oriented programming?
Hiding unnecessary information
Using variables of different types at different times
Reusing code from another class
Hiding the internal state of an object
8
What is the primary goal of object-oriented programming?
To perform complex mathematical operations
To write code in a procedural style
To manage and organize code using objects and classes
To optimize/speed up the performance of code
9
The __str__() method is used to define how an object is represented as a string.
False
True
10
What number will be printed after this code is run?
15
12
10
8