
Python Classes and Objects MCQ on 13.2.2025
Authored by Dr. 2397
Computers
12th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax to define a class in Python?
class: ClassName()
define class ClassName()
class ClassName[]:
class ClassName: pass
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you create an object from a class in Python?
You create an object by calling the class: my_object = MyClass()
You create an object by importing the class: from my_module import MyClass
You create an object by defining a variable: my_object = 'MyClass'
You instantiate an object using the new keyword: my_object = new MyClass()
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of a class method in Python?
To modify instance attributes directly
To create new instances of the class
To define instance-specific behavior
The purpose of a class method is to operate on the class itself rather than on instances of the class.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you access attributes of an object in Python?
Use dot notation (object.attribute) or getattr(object, 'attribute').
Use square brackets (object[attribute])
Call the attribute directly (object.attribute())
Access attributes using the object.get(attribute) method
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between a class method and an instance method?
Class methods require an instance of the class to be called.
Class methods operate on the class level, while instance methods operate on the instance level.
Class methods can only be called from within the class itself.
Instance methods can modify class-level attributes directly.
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
10 questions
Cap Cut
Quiz
•
12th Grade
10 questions
4.TR - SJiWP - CSS - 06 (do 64)
Quiz
•
12th Grade
10 questions
Google Drive
Quiz
•
KG - University
10 questions
HTML5 Forms
Quiz
•
11th - 12th Grade
10 questions
C++ quiz
Quiz
•
10th Grade - Professi...
10 questions
Latihan Interface
Quiz
•
9th - 12th Grade
10 questions
ATC Review
Quiz
•
9th - 12th Grade
10 questions
Android1
Quiz
•
1st Grade - 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