OOPS in Python
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Medium
Harmeet Kaur
Used 2+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
1. Which of the following best describes encapsulation?
Answer explanation
Encapsulation hides internal state and provides controlled access via methods.
2.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
2. What will be printed by the following code?
Answer explanation
B calls A.__init__ (value=5) then adds 5, so display prints 10.
3.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
3. In OOP, 'is-a' relationship is implemented through:
Answer explanation
Inheritance models the 'is-a' relationship between classes.
4.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
4. What is the output?
Answer explanation
Default parameter n=1; x1 has 5, x2 has 1; __str__ returns those.
5.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
5. Which is TRUE about method overriding?
Answer explanation
Overriding requires same signature to redefine parent behavior.
6.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
6. What will the following code output?
Answer explanation
Derived.__init__ replaces Base.__init__; data is set to 'Derived'.
7.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
7. Which of these is NOT an advantage of OOP?
Answer explanation
OOP improves design and reuse; it does not guarantee faster runtime.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
Preguntas sobre Excel 2016
Quiz
•
6th Grade - University
15 questions
Problem Solving : Design Solution
Quiz
•
12th Grade
10 questions
Python with DataScience
Quiz
•
7th Grade - University
10 questions
CPU & Storage
Quiz
•
12th Grade
10 questions
Q3 G9/10 Quiz on Site Development Plan M8
Quiz
•
9th Grade - University
10 questions
Pseudocode WHILE Loops
Quiz
•
10th - 12th Grade
14 questions
ITGS - IT Systems (Hardware)
Quiz
•
10th - 12th Grade
13 questions
ICT and Retail Industry
Quiz
•
8th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
