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 number is printed after this code is run?
50
15
10
Nothing, it returns an error
2
What number will be printed after this code is run?
10
8
15
12
3
The __str__() method is used to define how an object is represented as a string.
True
False
4
The first argument of a method (typically self) is used to refer to the class itself.
True
False
5
What is the purpose of abstraction in object-oriented programming?
Reusing code from another class
Using variables of different types at different times
Hiding the internal state of an object
Hiding unnecessary information
6
What is the primary goal of object-oriented programming?
To write code in a procedural style
To perform complex mathematical operations
To optimize/speed up the performance of code
To manage and organize code using objects and classes
7
What is NOT one of the main concepts of OOP?
Compilation
Inheritance
Encapsulation
Polymorphism
8
You define a class in Python by starting with the keyword "class".
True
False
9
What is printed after this code is run?
This is a Toyota with 4 wheels.
car.describe()
This is a Vehicle with 4 wheels.
This is a Toyota with 0 wheels.
10
What method is always executed when classes are initialized?
__create__()
__new__()
__start__()
__init__()