Python - Class
Quiz
•
Education
•
12th Grade - University
•
Practice Problem
•
Hard
Teaching Assistant Ivy
Used 70+ times
FREE Resource
Enhance your content in a minute
11 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Select correct python packages from following
numpy
opencv
math
matplotlib
decimal
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is called when a function is defined inside a class?
class
method
module
function
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A variable that is defined inside a method and belongs only to the current instance of a class is known as?
Inheritance
Instance variable
Function overloading
Instantiation
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be output for the folllowing code?
class test:
def __init__(self,a):
self.a=a
def display(self):
print(self.a)
obj=test()
obj.display()
Runs normally, doesn’t display anything
Displays 0, which is the automatic default value
Error as one argument is required while creating the object
Error as display function requires additional argument
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Suppose B is a subclass of A, to invoke the __init__ method in A from B, what is the line of code you should write?
A.__init__(self)
B.__init__(self)
A.__init__(B)
B.__init__(A)
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following piece of code?
class Test:
def __init__(self):
self.x = 0
class Derived_Test(Test):
def __init__(self):
Test.__init__(self)
self.y = 1
def main():
b = Derived_Test()
print(b.x,b.y)
main()
Error because class B inherits A but variable x isn’t inherited
0 1
0 0
Error, the syntax of the invoking method is wrong
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does built-in function type do in context of classes?
Determines the object name of any value
Determines the class name of any value
Determines class description of any value
Determines the file name of any value
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
Clippers
Quiz
•
University
10 questions
Projectile Motion 1.0
Quiz
•
University
10 questions
Republic Day Quiz
Quiz
•
KG - 12th Grade
12 questions
MANUEL GONZALES PRADA 2023 II
Quiz
•
University
15 questions
Foundations of Education Quiz
Quiz
•
University
10 questions
ETIMOLOGÍAS GRECOLATINAS 1 PARCIAL 2
Quiz
•
10th Grade - University
10 questions
Digital Environments Quiz
Quiz
•
University
10 questions
2023-Bài test nhanh cuối chuyên đề
Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
Discover more resources for Education
28 questions
Ser vs estar
Quiz
•
9th - 12th Grade
34 questions
Geometric Terms
Quiz
•
9th - 12th Grade
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
16 questions
Proportional Relationships And Constant Of Proportionality
Quiz
•
7th - 12th Grade
10 questions
DNA Replication Concepts and Mechanisms
Interactive video
•
7th - 12th Grade
10 questions
Unit 2: LS.Bio.1.5-LS.Bio.2.2 Power Vocab
Quiz
•
9th - 12th Grade
20 questions
Food Chains and Food Webs
Quiz
•
7th - 12th Grade
15 questions
Identify Triangle Congruence Criteria
Quiz
•
9th - 12th Grade
