Python Advanced
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Mayank Saxena
Used 2+ times
FREE Resource
Enhance your content in a minute
100 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword starts a class definition in Python?
Answer explanation
Classes are defined using the 'class' keyword.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is automatically invoked when a new instance is created?
Answer explanation
__init__ is the constructor called after an instance is created.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the 'self' parameter in instance methods refer to?
Answer explanation
'self' refers to the instance on which the method is called.
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of these is an example of encapsulation?
Answer explanation
Encapsulation hides implementation details; name mangling (prefix __) limits external access.
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
How do you indicate a 'private' attribute by convention in Python?
Answer explanation
By convention a single underscore prefix (e.g., _attr) indicates 'protected' or internal use.
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is name mangling in Python?
Answer explanation
Name mangling rewrites __attr as _ClassName__attr to reduce accidental access.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which decorator defines a class method that receives the class instead of instance?
Answer explanation
@classmethod receives the class (cls) as the first argument.
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
98 questions
FIRST QUARTERLY EXAMINATION - GRADE 4 - HELE/COMPUTER
Quiz
•
4th Grade - University
101 questions
Exchange-Server
Quiz
•
University
103 questions
100Q-CNPM_[PDK]
Quiz
•
University
100 questions
SEO Quiz
Quiz
•
University
100 questions
First Model Test MCQ - HCI
Quiz
•
University
100 questions
A+ CORE 2 FINAL REVIEW QUIZ
Quiz
•
University
99 questions
untitled
Quiz
•
12th Grade - University
100 questions
Science and Technology
Quiz
•
University
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
